我在python上使用selenium,我需要在xpath元素上执行.click()但是当我启动脚本时显示错误:
我用:
add_link = driver.find_element_by_xpath("//*[@id='delicious']/div[1]/aside/ul/li[5]/a")
add_link.click()
然后告诉我:
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 65, in click
self._execute(Command.CLICK_ELEMENT)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 402, in _execute
return self._parent.execute(command, params)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 175, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 166, in check_response
raise exception_class(message, screen, stacktrace)
Stacktrace:
at fxdriver.preconditions.visible (file:///tmp/tmpP85qVY/extensions/fxdriver@googlecode.com/components/command-processor.js:9587)
at DelayedCommand.prototype.checkPreconditions_ (file:///tmp/tmpP85qVY/extensions/fxdriver@googlecode.com/components/command-processor.js:12257)
at DelayedCommand.prototype.executeInternal_/h (file:///tmp/tmpP85qVY/extensions/fxdriver@googlecode.com/components/command-processor.js:12274)
at DelayedCommand.prototype.executeInternal_ (file:///tmp/tmpP85qVY/extensions/fxdriver@googlecode.com/components/command-processor.js:12279)
at DelayedCommand.prototype.execute/< (file:///tmp/tmpP85qVY/extensions/fxdriver@googlecode.com/components/command-processor.js:12221)