簡體   English   中英

Python/selenium 如何使用未檢測到的 chromedriver 代理

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

每當我嘗試使用帶有 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)

如何使代理與未檢測到的 chromedriver 一起工作?

這是網站https://www.myexternalip.com/raw :使用未檢測到的 chromedriver(提供我的實際 ip)

ip地址

謝謝你的幫助。

得到它的工作:

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

再次感謝您的“幫助”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM