[英]Selenium Python browser=webdriver.Firefox() error
[英]selenium python webdriver.Firefox() fails to connect
我在python中用硒嘗試了一些非常簡單的東西
from selenium import webdriver
q = webdriver.Firefox()
我得到這個回應
Traceback (most recent call last): File "", line 1, in File "/home/rcortes/.local/lib/python2.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 61, in __init__ desired_capabilities=capabilities) File "/home/rcortes/.local/lib/python2.6/site-packages/selenium/webdriver/remote/webdriver.py", line 72, in __init__ self.start_session(desired_capabilities, browser_profile) File "/home/rcortes/.local/lib/python2.6/site-packages/selenium/webdriver/remote/webdriver.py", line 114, in start_session 'desiredCapabilities': desired_capabilities, File "/home/rcortes/.local/lib/python2.6/site-packages/selenium/webdriver/remote/webdriver.py", line 165, in execute self.error_handler.check_response(response) File "/home/rcortes/.local/lib/python2.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 136, in check_response raise exception_class(value) 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 color:#333333;\n background-color: #ffffff;\n}\nh1 {\n font-size: 18px;\n font-weight: bold;\n text-decoration: none;\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 border: 3px solid #9f9f9f;\n padding: 10px 25px 10px 25px;\n margin: 10px 35px 0px 30px;\n background-color: #ffffff;\n width: 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 /* For IE 8 */\n -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color=\'cccccc\')";\n /* For IE 5.5 - 7 */\n filter: progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color=\'cccccc\');\n}\n.logo {\n border: none;\n margin: 5px 5px 0px 30px;\n}\n\n\n\n\n\n\n\n
This Page Cannot Be Displayed
\n\n\n\nThe system cannot communicate with the external server ( 127.0.0.1 ).\nThe Internet server may be busy, may be permanently down, or may be\nunreachable because of network problems.\n
\n\n\nPlease check the spelling of the Internet address entered.\nIf it is correct, try this request later.\n
\n\n\n\n\nIf you have questions, please contact\nyour corporate network administrator \nand provide the codes shown below.\n
\n\n\n\n\nDate: Thu, 17 Oct 2013 17:48:26 PDT
\n\n'
\nUsername:
\nSource IP: 10.130.49.59
\nURL: POST http://127.0.0.1/hub/session
\nCategory: Infrastructure and Content Delivery Networks
\nReason: UNKNOWN
\nNotification: GATEWAY_TIMEOUT\n
我試圖遵循這些簡單的指示http://docs.seleniumhq.org/docs/03_webdriver.jsp 。 請幫忙
我想到了。 即使firefox禁用了Intranet站點的代理,我相信selenium仍在嘗試通過代理連接到服務器。 我只是禁用了代理並且它起作用了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.