【问题标题】:selenium python webdriver.Firefox() fails to connectselenium python webdriver.Firefox()无法连接
【发布时间】:2013-10-26 17:19:39
【问题描述】:

我在 python 中尝试使用 selenium 做一些非常简单的事情


from selenium import webdriver
q = webdriver.Firefox()

我得到了这个回复

回溯(最近一次通话最后): 文件“”,第 1 行,在 文件“/home/rcortes/.local/lib/python2.6/site-packages/selenium/webdriver/firefox/webdriver.py”,第 61 行,在 __init__ 期望的能力=能力) __init__ 中的文件“/home/rcortes/.local/lib/python2.6/site-packages/selenium/webdriver/remote/webdriver.py”,第 72 行 self.start_session(desired_capabilities, browser_profile) 文件“/home/rcortes/.local/lib/python2.6/site-packages/selenium/webdriver/remote/webdriver.py”,第 114 行,在 start_session 'desiredCapabilities':desired_capabilities, 文件“/home/rcortes/.local/lib/python2.6/site-packages/selenium/webdriver/remote/webdriver.py”,第 165 行,在执行 self.error_handler.check_response(响应) 文件“/home/rcortes/.local/lib/python2.6/site-packages/selenium/webdriver/remote/errorhandler.py”,第 136 行,在 check_response 引发异常类(值) selenium.common.exceptions.WebDriverException: Message: u'\n\n\n\nNotification: Gateway Timeout\n\n\nbody {\n font-family: Arial, Helvetica, sans-serif;\n font-size: 14px;\n 颜色:#333333;\n 背景颜色:#ffffff;\n}\nh1 {\n 字体大小:18px;\n 字体粗细:粗体;\n 文字装饰:无;\n padding-top: 0px;\n color: #2970A6;\n}\na:link {\n color: #2970A6;\n text-decoration: none;\n}\na:hover {\n color: #2970A6 ;\n text-decoration: underline;\n}\np.buttonlink {\n margin-bottom: 24px;\n}\n.copyright {\n font-size: 12px;\n color: #666666;\n margin: 5px 5px 0px 30px;\n\n}\n.details {\n font-size: 14px;\n color: #969696;\n border: none;\n padding: 20px 20px 20px 20px;\n margin : 0px 10px 10px 35px;\n}\n\n.shadow {\n 边框: 3px solid #9f9f9f;\n padding: 10px 25px 10px 25px;\n margin: 10px 35px 0px 30px;\n 背景颜色: # ffffff;\n 宽度: 600px;\n\n -moz-box-shadow: 3px 3px 3px #cccccc;\n -webkit-box-shadow: 3px 3px 3px #cccccc;\n box-shadow: 3px 3px 3px #cccccc;\n /* 对于 IE 8 */\n -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color=\'cccccc\')";\n /*对于 IE 5.5 - 7 */\n 过滤器: progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color=\'cccccc\');\n}\n.logo {\n border: none; \n 边距:5px 5px 0px 30px;\n}\n\n\n\n\n\n

 

\n\n

此页面无法显示

\n\ n\n

\n系统无法与外部服务器 ( 127.0.0.1 ) 通信。\n互联网服务器可能正忙、可能永久关闭或可能\n由于网络问题而无法访问。\n

\n\n

\n请检查输入的 Internet 地址的拼写。\n如果正确,请稍后再试。\n

\n\n\n\n

\n如果您有如有问题,请联系\n您的公司网络管理员\n并提供如下所示的代码。\n

\n\n\n\n

\n日期:2013 年 10 月 17 日星期四 17:48:26 PDT
\n用户名:
\n源 IP:10.130.49.59
\nURL:POST http://127.0.0.1/hub/session
\n类别:基础设施和内容交付网络
\n原因:未知
\n通知:GATEWAY_TIMEOUT\n

\n\n'

我正在尝试遵循这些简单的指示http://docs.seleniumhq.org/docs/03_webdriver.jsp。请帮忙

【问题讨论】:

  • 这是你的完整代码吗?
  • 是的,我只是想用最简单的配置启动 Firefox webdriver。根据文档,这应该有效。干杯
  • 您的 wifi/ether 是否正常工作?
  • 是的。我能够连接到一切。

标签: python selenium


【解决方案1】:

我想通了。尽管 Firefox 禁用了 Intranet 站点的代理,但我相信 selenium 仍在尝试通过代理连接到服务器。我刚刚禁用了代理,它起作用了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-22
    • 2016-12-31
    • 2013-01-14
    • 2013-09-30
    • 1970-01-01
    • 2016-05-10
    相关资源
    最近更新 更多