我正在使用Selenium WebDriver(v2.5.0).当我使用driver.click(...)"命令时,我收到此错误
Element is not currently visible and so may not be interacted with Build info: version: '2.5.0', revision: '13516', time: '2011-08-23 18:30:44' System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.38-10-generic', java.version: '1.6.0_26' Driver info: driver.version: RemoteWebDriver
Run Code Online (Sandbox Code Playgroud)
在鼠标悬停在元素上的浏览器中,单击的元素变为可见.有没有办法检查某些东西是否可见?
我已经尝试过这个页面的方法: 在 Python 中使用 Selenium 上传文件
代码:
file_button = browser.find_element_by_id('fileUploadProxy')
file_button.send_keys('/Users/home/Downloads/1-Students-and-Parent-Email.csv')
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
Traceback (most recent call last):
File "test.py", line 110, in <module>
upload_students_results('Surname, Name')
File "test.py", line 91, in upload_students_results
file_button.send_keys('/Users/home/Downloads/1-Students-and-Parent-Email.csv')
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webelement.py", line 349, in send_keys
'value': keys_to_typing(value)})
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webelement.py", line 493, in _execute
return self._parent.execute(command, params)
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 249, in execute
self.error_handler.check_response(response)
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 193, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot focus element
(Session info: chrome=58.0.3029.96)
(Driver info: chromedriver=2.29.461585 (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac …Run Code Online (Sandbox Code Playgroud)