页面布局,如下图
只定位第一个标签,输入值时报错,如下
driver = webdriver.Chrome()
driver.get(‘http://xxx.com/’)
password = driver.find_element_by_id(“txt”)
password.clear()
password.send_keys(‘22222’)
报错如下:
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot focus element
(Session info: chrome=70.0.3538.110)
(Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a),platform=Windows NT 10.0.16299 x86_64)
只定位第二个标签,输入值时报错,如下
driver = webdriver.Chrome()
driver.get(‘http://xxx.com/’)
password = driver.f