简体   繁体   English

Python/selenium 如何使用未检测到的 chromedriver 代理

[英]Python/selenium how to use proxy with undetected-chromedriver

whenever I try to use a proxy with undetedted-chromedriver, it just doesn't work and diplays my ip. When I use the normal webdriver, it works perfectly.每当我尝试使用带有 undetedted-chromedriver 的代理时,它就无法工作并显示我的 ip。当我使用普通的 webdriver 时,它工作得很好。

from selenium import webdriver
from time import sleep


ip_port = "ip:port"

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--proxy-server=%s' % ip_port)
driver = uc.Chrome(use_subprocess=True, chrome_options=chrome_options)

driver.get('https://www.myexternalip.com/raw')
sleep(999)

How can I make the proxy work with undetected chromedriver?如何使代理与未检测到的 chromedriver 一起工作?

This is the site https://www.myexternalip.com/raw : With undetected chromedriver (gives my actual ip)这是网站https://www.myexternalip.com/raw :使用未检测到的 chromedriver(提供我的实际 ip)

ip地址

Thanks for your help.谢谢你的帮助。

Got it work with:得到它的工作:

chrome_options = Options()
    chrome_options.add_argument('--proxy-server=ip:port')
    driver = uc.Chrome(options=chrome_options)
    driver.get('https://www.myexternalip.com/raw')

thanks once again with your "help"再次感谢您的“帮助”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Undetected-Chromedriver 上的 Chromedriver 版本不正确 - Incorrect Version of Chromedriver on Undetected-Chromedriver 连接到 undetected-chromedriver docker 镜像 - Connect to undetected-chromedriver docker image OSError:使用未检测到的 chromedriver 时 [WinError 6] - OSError: [WinError 6] when using undetected-chromedriver 使用未检测到的 chromedriver 时出现 TypeError - TypeError when using undetected-chromedriver 如何使用 Selenium Python 将所需功能传递给未检测到的 Chromedriver? - How to pass Desired Capabilities to Undetected Chromedriver with Selenium Python? 如何在 Brave 中使用未检测到的 chromedriver - How to use undetected chromedriver with Brave `cannot connect to chrome at 127.0.0.1:37541` when using undetected-chromedriver with Python - `cannot connect to chrome at 127.0.0.1:37541` when using undetected-chromedriver with Python 我正在使用 selenium undetected-chromedriver,我无法一次打开多个配置文件并浏览它们 - I'm using selenium undetected-chromedriver and I can't open multiple profiles at once and navigate through them 如何在 selenium chromedriver 中使用经过身份验证的代理? - How to use authenticated proxy in selenium chromedriver? Python Selenium:从 undetected_chromedriver 获取标头 - Python Selenium: Get headers from undetected_chromedriver
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM