我一直试图让selenium.webdriver中的ActionChains在Python 3.5中运行。看过以前对类似问题的答案后,即使我尝试了很多不同版本的调用ActionChains,我也没有找到适合我的任何答案。这是我的代码:
类LoginTest():
Traceback (most recent call last):
File "C:\Users\Evan\Desktop\Tester.py", line 73, in <module>
x.reachLikes()
File "C:\Users\Evan\Desktop\Tester.py", line 30, in reachLikes
webdriver.ActionChains(driver).move_to_element(searchQueryElement).perform()
File "C:\Users\Evan\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\action_chains.py", line 74, in perform
action()
File "C:\Users\Evan\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\action_chains.py", line 225, in <lambda>
Command.MOVE_TO, {'element': to_element.id}))
File "C:\Users\Evan\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "C:\Users\Evan\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: POST /session/6e980f69-8e37-4368-95fd-f16a183303a2/moveto did not match a known command
对于很多人(我观看了一些视频),这有效,但是当我尝试执行操作时,我总是会收到以下错误:
{{1}}
有关如何处理此错误的任何建议?对于为什么这对某些人而不是对其他人有效的建议?