我一直在努力弄清楚我的代码发生了什么,但我无能为力。
每当我运行我的程序时,我都会收到下图中的错误。
我正在使用 python 3.4.4 和 selenium 的最新版本。
Windows 10
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()
错误图片 https://i.stack.imgur.com/l6hSz.png
你没有提到你的 FF 版本是什么,我认为它是最新的版本之一。无论如何,你需要使用低于 47 的 FF 或时间切换到 MarionetteDriver
这是一些有用的信息Selenium 2.53 无法在 Firefox 47 上运行 https://stackoverflow.com/questions/37693106/selenium-2-53-not-working-on-firefox-47
希望有帮助,加油。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)