我一直在尝试使用简单的python脚本加载我的Firefox(Mozilla Firefox 49.0),并在Ubuntu 16.04.1 LTS上使用selenium-2.53.6,但即使selenium's basic example 0也不起作用:
来自selenium import webdriver browser = webdriver.Firefox()browser.get('http://seleniumhq.org/')
我总是在大约5秒后超时,并且firefox崩溃并显示以下消息:
“无法加载配置文件 . 配置文件目录:/ tmp / tmpl5qlfokc如果在FirefoxBinary构造函数中指定了log_file,请检查其详细信息”
所以我创建了一个特定的firefox配置文件(profile -p),并使用它,写道:
profile = webdriver.FirefoxProfile('配置文件夹的绝对路径')driver = webdriver.Firefox(profile)
但似乎无论我做什么,浏览器在5秒后崩溃 .
阅读帖子can't load profile on firefox并按照说明操作,但遗憾的是结果相同 . 有谁知道如何解决这个问题?
谢谢你们!
1 回答
对于firefox 49.0你需要selenium 3(它为's in beta stage, that' s为什么你不能用
pip -U
下载它)和geckodriver .试试这个: