You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用UC Driver进行Python爬虫时代理IP未生效的问题求助

使用UC Driver进行Python爬虫时代理IP未生效的问题求助

我现在在用Python的UC Driver做爬虫,但遇到个头疼的问题——设置的代理好像完全没改变我的IP地址。我想确认下是UC Driver本身就这样,还是我哪里配置错了?因为目标网站没法直接发请求,只能用类似Selenium的方式来爬。

我试过免费匿名代理列表里的代理,也用过Oxylab数据库的代理和ZenRow代理,但结果全都是一样的,IP始终没切换成功。

以下是我目前的代码:

proxy = "https://47.251.122.81:8888"

options = uc.ChromeOptions()
options.add_argument("--mute-audio")
options.add_argument("--ignore-certificate-errors")
options.add_argument("--disable-web-security")
options.add_argument("--allow-running-insecure-content")
options.add_argument("--disable-features=IsolateOrigins,site-per-process")
options.add_argument("window-size=1680,1050")
options.add_argument("--disable-gpu")
options.add_argument("--mute-audio")
options.add_argument(f"--proxy-server={proxy}")
driver = uc.Chrome(
    options=options,
    use_subprocess=False,
)
driver.get('https://www.whatsmyip.org/')
time.sleep(30)

备注:内容来源于stack exchange,提问作者gustas badaitis

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.14 13:13:12