[英]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)
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.