使用Windows 10在Selenium for Python中打开Firefox

Dav*_* J. 2 python firefox selenium windows-10

我正在尝试按照本教程进行操作

http://chimera.labs.oreilly.com/books/1234000000754/ch01.html#_obey_the_testing_goat_do_nothing_until_you_have_a_test

我有以下代码使用Selenium打开一个firefox浏览器:

from selenium import webdriver

browser = webdriver.Firefox()
browser.get('http://localhost:8000')

assert 'Django' in browser.title
Run Code Online (Sandbox Code Playgroud)

但是,Firefox会打开一个恼人的Windows 10'欢迎'页面,并且永远不会访问我指定的URL.我该如何解决这个问题?

ale*_*cxe 6

Firefox 43和selenium 2.47存在兼容性问题.

升级selenium到最新版本(目前为2.48):

pip install --upgrade selenium
Run Code Online (Sandbox Code Playgroud)