【发布时间】:2016-07-05 14:34:01
【问题描述】:
在 Windows 10 上使用 Firefox 47.1,我尝试运行给定 here 的 selenium 示例 2。启动脚本时,会打开一个新的 Firefox 窗口,一段时间后 PyCharm 控制台中会显示以下错误:
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: C:\Users\alex\AppData\Local\Temp\tmpocxmjp8i If you specified a log_file in the FirefoxBinary constructor, check it for details.
有没有简单的方法来解决这个问题?我还升级到了最新的 python webdriver(版本 2.53.6)。
换行
browser = webdriver.Firefox()
用线
browser = webdriver.Chrome()
在示例中它是否起作用。所以它适用于 chrome。
【问题讨论】:
-
它是否从命令行工作(不是 pycharm)
-
是的,它确实可以从命令行工作...
-
我敢打赌这是一个兼容性问题。尝试使用旧版本的 Firefox。试试 FF 43 以确保它得到很好的支持。
-
即使我能够安装旧版本的 Firefox?
-
这很容易。您可以在此处获得 Mozilla 官方提供的完整列表:ftp.mozilla.org/pub/firefox/releases。因此,只需卸载您当前的 FF 并安装一个新的。安装后,快速进入设置并配置为不自动下载新版本。
标签: python selenium firefox selenium-webdriver