小编Mat*_*eus的帖子

Selenium-Firefox的MoveTargetOutOfBoundsException

我在Firefox Webdriver上的move_to_element 函数遇到问题(Chrome,IE运行良好)

driver = webdriver.Firefox()
driver.get("https://stackoverflow.com")
time.sleep(5)
source_element = driver.find_element_by_xpath('//*[@id="footer"]/div/ul/li[1]/a')
ActionChains(driver).move_to_element(source_element).perform()
Run Code Online (Sandbox Code Playgroud)

我正在使用以下版本:geckodriver-0.17.0 // Firefox-54.0 //硒-3.4.3

运行此脚本后,在输出中显示:

selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: (134.96666717529297, 8682.183013916016) is out of bounds of viewport width (1268) and height (854) 
Run Code Online (Sandbox Code Playgroud)

python firefox selenium python-2.7 selenium-webdriver

8
推荐指数
3
解决办法
1万
查看次数