TA的每日心情 | 无聊 昨天 09:47 |
---|
签到天数: 528 天 连续签到: 1 天 [LV.9]测试副司令
|
1测试积点
问题如下:
- # 点击被罚款部门
- driver.find_element_by_xpath('//body/div[2]/div[1]/div[2]/form[1]/div[3]/div[1]/div[1]/div[1]/div[1]/input[1]').click()
- sleep(2)
- element = driver.find_element_by_xpath('//body/div[4]/div[1]/div[1]/ul[1]/li[3]')
- sleep(1)
- element.click()
- driver.execute_script("arguments[0].click();", element)
复制代码 定位没有问题,但是一直报element not interactable怎么解决?
报错如下:
- Traceback (most recent call last):
- File "C:/xianyikun/shuangchongyufang/cesi.py", line 39, in <module>
- element.click()
- File "C:\Python38\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click
- self._execute(Command.CLICK_ELEMENT)
- File "C:\Python38\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute
- return self._parent.execute(command, params)
- File "C:\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
- self.error_handler.check_response(response)
- File "C:\Python38\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
- raise exception_class(message, screen, stacktrace)
- selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
- (Session info: chrome=92.0.4515.131)
-
- Process finished with exit code 1
复制代码
|
|