提问人:Wahab Khaddim 提问时间:11/1/2023 更新时间:11/1/2023 访问量:22
Geosurf 代理服务器和未检测到的 chromedriver 中的用户身份验证
Geosurf Proxy server and user authentication in undetected chromedriver
问:
我正在尝试在本地验证 geosurf 代理,因为未检测到的 chromedriver 确实有任何弹出窗口/窗口(当浏览器打开时)可以手动填写用户名和密码。
这是我的代码:
import time
import urllib.request as req
import os
import undetected_chromedriver as uc
if __name__ == '__main__':
print(req.getproxies())
os.environ['http_proxy'] = "http://username:password@proxy-server:port"
os.environ['https_proxy'] = "http://username:password@proxy-server:port"
options = uc.ChromeOptions()
options.headless = False
options.add_argument('--proxy-server=proxy-server:port')
driver = uc.Chrome(options=options, use_subprocess=False)
driver.get('https://google.com')
time.sleep(2)
driver.quit()
我收到此错误:
Traceback (most recent call last):
File "F:\Web_Automation\Ticket_Buy\proxy_testing.py", line 45, in <module>
driver = uc.Chrome(options=options, use_subprocess=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Web_Automation\venv\Lib\site-packages\undetected_chromedriver\__init__.py", line 466, in __init__
super(Chrome, self).__init__(
File "F:\Web_Automation\venv\Lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 45, in __init__
super().__init__(
File "F:\Web_Automation\venv\Lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 56, in __init__
super().__init__(
File "F:\Web_Automation\venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 205, in __init__
self.start_session(capabilities)
File "F:\Web_Automation\venv\Lib\site-packages\undetected_chromedriver\__init__.py", line 724, in start_session
super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
File "F:\Web_Automation\venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 289, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Web_Automation\venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 344, in execute
self.error_handler.check_response(response)
File "F:\Web_Automation\venv\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 193, in check_response
raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message: dial tcp 192.168.1.85:0->127.0.0.1:64940: connectex: The requested address is not valid in its context.
Exception ignored in: <function Chrome.__del__ at 0x0000016A2D12D580>
Traceback (most recent call last):
File "F:\Web_Automation\venv\Lib\site-packages\undetected_chromedriver\__init__.py", line 843, in __del__
File "F:\Web_Automation\venv\Lib\site-packages\undetected_chromedriver\__init__.py", line 798, in quit
OSError: [WinError 6] The handle is invalid
代理凭据在这里是别名,我没有写过真正的凭据,但相信我它们是正确的。我在这里做错了什么?我求求你帮帮我。
答: 暂无答案
评论