【问题标题】:Using proxy with Selenium in Python在 Python 中使用带有 Selenium 的代理
【发布时间】:2019-07-11 12:41:57
【问题描述】:

我正在尝试在 python 中使用带有 selenium 的代理,但我尝试过的方法都没有奏效,chrome 试图访问该网站但没有成功。 我正在使用来自https://free-proxy-list.net/的代理

executable_path = r"C:\Users\user\PycharmProjects\WebScrape\chromedriver75.exe"
proxy_address = "94.230.148.233:61576"

chrome_options = Options()
chrome_options.add_argument("--proxy-server=" + proxy_address)

driver = webdriver.Chrome(executable_path=executable_path, options=chrome_options)
driver.set_page_load_timeout(60)
driver.get("https://whatismyipaddress.com/")

我也尝试更改页面超时,但没有成功。

【问题讨论】:

    标签: python selenium google-chrome proxy


    【解决方案1】:

    尝试使用http,所以

    chrome_options.add_argument("--proxy-server=http://94.230.148.233:61576")
    

    【讨论】:

      【解决方案2】:

      好的,所以经过几个小时的搜索,我终于找到了解决方案,看这里:Problems with setting up proxy for chrome using selenium 3.8.1

      【讨论】:

        猜你喜欢
        • 2013-06-25
        • 2018-06-11
        • 2021-02-07
        • 2022-01-22
        • 2016-12-05
        • 2021-09-05
        • 2019-01-24
        • 2023-03-29
        相关资源
        最近更新 更多