如何解决 selenium 和 firefox 产生的 profile 问题

2016-09-19 22:06:34 +08:00
 redhatping

我们在使用 selenium 进行各种操作,经常会出现 Message: Can't load the profile 这个问题。 大体上,这个问题,经常是 selenium 和 firefox 兼容性问题。问题本质上是我们往往安装最新版的firefox,有谁去安装旧版本呢。。 虽然我们常说旧版本兼容好。

一般情况下, 基本上 google : pip install - U selenium. 但是, pip 是否支持的版本只有到 2.8.3. 而实际上 selenium 官网已经是 3.0 了。 我们应该怎么做呢? 两个问题:

1 , pip install ....whl (升级到 selenium 3.0)

  1. mv geckodriver /usr/local/bin

其中 geckodriver 到这里下载。 https://github.com/mozilla/geckodriver/releases

其实我们在 ubuntu 系统中, 出现的各种问题, 一般也在 geckodriver 问题上。

水平有限,暂时不知道为什么安装 firefox 不够,还需要安装 geckodriver 这个核心。

总结完毕, 希望能帮助到各位 google 和百度的朋友们。

4061 次点击
所在节点    Python
5 条回复
vibbow
2016-09-20 09:02:12 +08:00
装个 firefox esr 版
gimp
2016-09-20 11:07:54 +08:00
gouchaoer
2016-09-20 23:10:21 +08:00
这个问题我摸索了 1 个月,里面还有很多坑哒,做 firefox 的并发缓存啊 selenium 驱动 build 啊,挺折腾的。。。
redhatping
2016-09-22 08:10:05 +08:00
@gouchaoer 有总结吗
gouchaoer
2016-09-22 09:12:19 +08:00
@redhatping 没有,我是做爬虫的,你估计是搞测试前端的,需求不太一样。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/307375

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX