【问题标题】:Python selenium proxy authenticationPython selenium 代理身份验证
【发布时间】:2019-01-05 11:49:58
【问题描述】:

我目前正在尝试在 Firefox 中使用 user:pass proxies in selenium,但文档中的解决方案不起作用

from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType

myProxy = "host:port"
Proxy({
    'proxyType': ProxyType.MANUAL,
    'httpProxy': myProxy,
    'ftpProxy': myProxy,
    'sslProxy': myProxy,
    'noProxy': '' # set this value as desired
    })

driver = webdriver.Firefox(r'''C:\Users\ben_s\Desktop\geckodriver''',proxy=proxy)
driver.get("https://www.ipchicken.com/")

有没有办法可以调整此代码以使代理工作?还是有完全不同的方法?谢谢

【问题讨论】:

标签: python selenium geckodriver


【解决方案1】:

查看此答案here 提出的selenium-wire。它对我很有效。

【讨论】:

    猜你喜欢
    • 2013-10-18
    • 2023-04-06
    • 2021-10-07
    • 2022-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-10
    • 1970-01-01
    相关资源
    最近更新 更多