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
capturepointer
V2EX  ›  Python

selenium 的 webdriver 的问题

  •  
  •   capturepointer · 2017-11-23 20:40:00 +08:00 · 1707 次点击
    这是一个创建于 2344 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我想在 ubuntu server 下面,基于 selenium 的 webdriver 开发没有界面的爬虫,chrome 和 firefox 现在支持无界面 headless,但是在 windows 下面没有问题,在 ubuntu server 下面一直有问题,如下:

    File "firefox.py", line 39, in <module> driver = webdriver.Firefox() File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 154, in init keep_alive=True) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 151, in init self.start_session(desired_capabilities, browser_profile) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 240, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 308, in execute self.error_handler.check_response(response) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities

    求教下,在 ubuntu server 下面,可行吗?

    3 条回复    2017-11-24 07:53:44 +08:00
    capturepointer
        1
    capturepointer  
    OP
       2017-11-23 21:59:05 +08:00
    已经解决了,因为我 windows 上面安装了 firefox,也需要在 ubuntu server 上面安装 firefox
    iyaozhen
        2
    iyaozhen  
       2017-11-23 22:04:58 +08:00 via Android
    server 也能安装 Firefox ?

    话说怎么启动无界面模式呢?
    vipper
        3
    vipper  
       2017-11-24 07:53:44 +08:00 via iPhone
    PhantomJs 支持无界面
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1009 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:58 · PVG 05:58 · LAX 14:58 · JFK 17:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.