V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
redhatping
V2EX  ›  Python

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

  •  
  •   redhatping · 2016-09-19 22:06:34 +08:00 · 4042 次点击
    这是一个创建于 2781 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我们在使用 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 和百度的朋友们。

    5 条回复    2016-09-22 09:12:19 +08:00
    vibbow
        1
    vibbow  
       2016-09-20 09:02:12 +08:00
    装个 firefox esr 版
    gimp
        2
    gimp  
       2016-09-20 11:07:54 +08:00
    gouchaoer
        3
    gouchaoer  
       2016-09-20 23:10:21 +08:00 via Android
    这个问题我摸索了 1 个月,里面还有很多坑哒,做 firefox 的并发缓存啊 selenium 驱动 build 啊,挺折腾的。。。
    redhatping
        4
    redhatping  
    OP
       2016-09-22 08:10:05 +08:00
    @gouchaoer 有总结吗
    gouchaoer
        5
    gouchaoer  
       2016-09-22 09:12:19 +08:00 via Android
    @redhatping 没有,我是做爬虫的,你估计是搞测试前端的,需求不太一样。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1455 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 16:38 · PVG 00:38 · LAX 09:38 · JFK 12:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.