0

您好,我使用此行设置带有 chrome 驱动程序的代理,但在窗口打开之前我总是收到 407 错误。
我什至没有弹出输入我的凭据。
我尝试使用带有 chrome 的扩展程序来存储我的凭据,但得到了相同的结果。有谁知道解决方法?

代码最初来自https://proxyfuel.com/blog/rotating-proxy-selenium

from selenium import webdriver
PROXY = "user:pwd@host:PORT" 
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--proxy-server=%s' % PROXY)
chrome = webdriver.Chrome(options=chrome_options)
chrome.get("http://api.ipify.org")
body_text = chrome.find_element_by_tag_name('body').text
print(body_text)
chrome.quit()
4

0 回答 0