推荐学习书目
› 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 · Nov 23, 2017 · 2654 views
    This topic created in 3238 days ago, the information mentioned may be changed or developed.

    我想在 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 replies  •  2017-11-24 07:53:44 +08:00
    capturepointer
        1
    capturepointer  
    OP
       Nov 23, 2017
    已经解决了,因为我 windows 上面安装了 firefox,也需要在 ubuntu server 上面安装 firefox
    iyaozhen
        2
    iyaozhen  
       Nov 23, 2017 via Android
    server 也能安装 Firefox ?

    话说怎么启动无界面模式呢?
    vipper
        3
    vipper  
       Nov 24, 2017 via iPhone
    PhantomJs 支持无界面
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2633 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 03:47 · PVG 11:47 · LAX 20:47 · JFK 23:47
    ♥ Do have faith in what you're doing.