目的是想鼠标悬浮百度首页“设置”处
运行之后并没有悬停在设置处
报错如下:
Traceback (most recent call last):
File "D:/python/test.py", line 7, in <module>
ActionChains(driver).move_to_element(link).perform()
File "D:\Tool\python370\Python\Python37\lib\site-packages\selenium\webdriver\common\action_chains.py", line 80, in perform
self.w3c_actions.perform()
File "D:\Tool\python370\Python\Python37\lib\site-packages\selenium\webdriver\common\actions\action_builder.py", line 76, in perform
self.driver.execute(Command.W3C_ACTIONS, enc)
File "D:\Tool\python370\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
self.error_handler.check_response(response)
File "D:\Tool\python370\Python\Python37\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: The requested mouse movement to (1781, 16) would be outside the bounds of the current view port (left: 0, right: 1536, top: 79, bottom: 824) 作者: cq520131517 时间: 2018-9-17 09:09
中间加个时间等待试下 作者: NancyWangDL 时间: 2018-9-17 14:31
可以参考下博客:https://www.cnblogs.com/android-it/p/9371944.html,跟你写的差不多,你的报错猜测:是不是因为没有最大化你的ie导致定位找不到?个人猜测