Selenium WebDriver.get(url) does not open the URL

前端 未结 18 2016
醉梦人生
醉梦人生 2020-11-29 07:36
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui impo         


        
18条回答
  •  无人及你
    2020-11-29 07:57

    It is a defect of Selenium.
    I have the same problem in Ubuntu 12.04 behind the proxy.

    Problem is in incorrect processing proxy exclusions. Default Ubuntu exclusions are located in no_proxy environment variable:

    no_proxy=localhost,127.0.0.0/8
    

    But it seems that /8 mask doesn't work for selenium. To workaround the problem it is enough to change no_proxy to the following:

    no_proxy=localhost,127.0.0.1
    

    Removing proxy settings before running python script also helps:

    http_proxy= python script.py
    

提交回复
热议问题