我目前正尝试在一台新机器上使用selenium,并且遇到了以下问题和错误:
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details我看过下面关于这方面的文章,我似乎无法让它起作用。
我只是使用一个简单的测试:
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('https://google.com')我正在使用:
Firefox版本51.0.1 (32位) 我已经尝试过两个selenium版本2.53.6和3.0.2 我尝试下载Geckodriver并添加到系统变量路径中。
有人能告诉我我做错了什么吗?我是应该使用更早版本的selenium,还是对驱动程序做了错误的操作?
这里的任何帮助都会很好。
发布于 2017-03-28 15:42:23
只是有同样的问题。
我就是这样解决这个问题的。
pip install selenium安装brew install Geckodriver安装Geckodriverdriver = webdriver.Firefox(executable_path='/usr/local/bin/geckodriver')希望这能有所帮助
https://stackoverflow.com/questions/42383450
复制相似问题