【发布时间】:2022-05-26 15:47:42
【问题描述】:
我正在使用带有最新 Selenium 的 Python 3.9 并拥有此代码,该代码在我的 Mac 上运行良好,Chrome 驱动程序 101 我的脚本的无头实例...
element = self.driver.find_element(By.CSS_SELECTOR, "body")
actions = ActionChains(self.driver)
actions.move_to_element_with_offset(element, 0, 0).perform()
但是,当我在我的 CentOS 7 实例上运行相同的代码时,使用 chromedriver 99(最新可用),我收到此错误
> raise exception_class(message, screen, stacktrace)
E selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: move target out of bounds
E (Session info: headless chrome=99.0.4844.84)
/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py:242: MoveTargetOutOfBoundsException
关于这意味着什么或我可能需要在我的 CentOS 7 设置上进行哪些额外配置的任何想法?只要代码在两种环境中都运行,就很高兴重写代码。
【问题讨论】:
-
你能提供网页的网址吗?
标签: python-3.x selenium selenium-chromedriver macos-big-sur selenium-webdriver-python