When python controls selenium to click the login button, an error unknown error: Element is not clickable at point

 

Using python to control selenium to log in to a web page reports an error:

C:\Users\Desktop\selenium\chrome>python chrome.py

selenium.common.exceptions.WebDriverException: Message: unknown error: Element is not clickable at point (844, 555)
  (Session info: chrome=66.0.3359.117)
  (Driver info: chromedriver=2.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91),platform=Windows NT 10.0.16299 x86_64)

Solution:

The code is:
submitBtn=driver.find_element_by_id("loginButton1") //Get the login button 
submitBtn.click() //Click the button

Change to:

submitBtn=driver.find_element_by_id("loginButton1") //Get the login button 

driver.execute_script("arguments[0].scrollIntoView()", submitBtn);  

submitBtn.click() //Click the button

 

When viewing it online, there is a net saying that you can add sleep before clicking, but the problem has not been solved after my test.

 

 

 

Reference: https://blog.csdn.net/sinat_29673403/article/details/78459648

 
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324906480&siteId=291194637