Python selenium代理

Python selenium代理,python,selenium,parsing,web,proxy,Python,Selenium,Parsing,Web,Proxy,我看到了我的ip。如何使此代理工作?我需要更多关于错误的信息,但我认为如果您只是想使其工作: 最新版本: 从selenium导入webdriver PROXY=“” webdriver.DesiredCapabilities.FIREFOX['proxy']={ “httpProxy”:代理, “ftpProxy”:代理, “sslProxy”:代理, “proxyType”:“手动”, } 使用webdriver.Firefox()作为驱动程序: #打开URL 驱动程序。获取(“https:/

我看到了我的ip。如何使此代理工作?

我需要更多关于错误的信息,但我认为如果您只是想使其工作:

最新版本:

从selenium导入webdriver
PROXY=“”
webdriver.DesiredCapabilities.FIREFOX['proxy']={
“httpProxy”:代理,
“ftpProxy”:代理,
“sslProxy”:代理,
“proxyType”:“手动”,
}
使用webdriver.Firefox()作为驱动程序:
#打开URL
驱动程序。获取(“https://selenium.dev")

如果你想维护你的代码,我在本地测试了你的代码,发现你可以考虑用“代码> WebDealth.Firefox(FireFxxPrase= FP)< /Calp>

指定配置文件。你能编辑你的问题吗?”我不知道您的确切问题是什么。selenium.common.exceptions.WebDriverException:消息:到达的错误页面:关于:neterror?e=dnsNotFound&u=https%3A//selenium.dev/&c=UTF-8&d=We%20can%E2%80%99t%20连接%20到%20server%20at%20Elenium.dev。此错误发生在使用工作代理运行上述代码后。我也尝试使用此站点的不同答案使selenium工作,但它提供了无限重定向,因此不会更改ip。“页面重定向不正确Firefox检测到服务器正在以一种永远无法完成的方式重定向对此地址的请求。”
myProxy = '176.9.119.170:8080'
ip, port = myProxy.split(":")
fp = webdriver.FirefoxProfile()
fp.set_preference('network.proxy.type', 1)
fp.set_preference('network.proxy.http', ip)
fp.set_preference('network.proxy.http_port', int(port))
driver = webdriver.Firefox(fp)
driver.get('https://whatismyipaddress.com/')
from selenium import webdriver

PROXY = "<HOST:PORT>"
webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
    "httpProxy": PROXY,
    "ftpProxy": PROXY,
    "sslProxy": PROXY,
    "proxyType": "MANUAL",

}

with webdriver.Firefox() as driver:
    # Open URL
    driver.get("https://selenium.dev")