ultrafunkamsterdam / undetected-chromedriver

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
https://github.com/UltrafunkAmsterdam/undetected-chromedriver
GNU General Public License v3.0
9.76k stars 1.15k forks source link

User auth proxies are no longer working #142

Closed KhushC-03 closed 3 years ago

KhushC-03 commented 3 years ago

I have tried the user auth argument when adding options but it no longer works. what is the best way for user auth proxies to be used? with V2 by the way.

lazarostso commented 3 years ago

What method did you use before?

Avnsx commented 3 years ago

I have tried the user auth argument when adding options but it no longer works. what is the best way for user auth proxies to be used? with V2 by the way.

https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/82#issuecomment-817049203

lazarostso commented 3 years ago

I have tried the user auth argument when adding options but it no longer works. what is the best way for user auth proxies to be used? with V2 by the way.

#82 (comment) I have tried

options.add_argument("--proxy-server=https://username:password@proxy_ip:proxy_pass")

But i am getting:

This site can’t be reachedThe webpage at https://instagram.com/ might be temporarily down or it may have moved permanently to a new web address. ERR_NO_SUPPORTED_PROXIES

Avnsx commented 3 years ago

I have tried the user auth argument when adding options but it no longer works. what is the best way for user auth proxies to be used? with V2 by the way.

#82 (comment) I have tried

options.add_argument("--proxy-server=https://username:password@proxy_ip:proxy_pass")

But i am getting:

This site can’t be reachedThe webpage at https://instagram.com/ might be temporarily down or it may have moved permanently to a new web address. ERR_NO_SUPPORTED_PROXIES

https://github.com/wkeeling/selenium-wire#proxies

lazarostso commented 3 years ago

I have tried the user auth argument when adding options but it no longer works. what is the best way for user auth proxies to be used? with V2 by the way.

#82 (comment) I have tried

options.add_argument("--proxy-server=https://username:password@proxy_ip:proxy_pass") But i am getting: This site can’t be reachedThe webpage at https://instagram.com/ might be temporarily down or it may have moved permanently to a new web address. ERR_NO_SUPPORTED_PROXIES

https://github.com/wkeeling/selenium-wire#proxies

I tested:

import logging logging.basicConfig(level=logging.INFO) logging.getLogger('undetected_chromedriver').level = logging.INFO

from seleniumwire import webdriver import time

proxy = 'http://username:pass@prox_ip:proxy_port' options = { 'suppress_connection_errors': False, 'auto_config': False, 'addr': '0.0.0.0', 'port': 8087, 'proxy': { 'http': proxy, 'https': proxy }, }

chrome_options = webdriver.ChromeOptions() chrome_options.add_argument('--proxy-server=kubernetes-service-name:8087') chrome_options.add_argument('--ignore-certificate-errors')

browser = webdriver.Chrome(desired_capabilities=chrome_options.to_capabilities(), seleniumwire_options=options) time.sleep(1) browser.get("https://whatismyipaddress.com/") time.sleep(10)

but log info shows something like: INFO:seleniumwire.proxy.handler:Capturing request: https://whatismyipaddress.com/favicon.ico

I have used pip install undetected-chromedriver but I assume that undetected-chromedriver is not activated.

Avnsx commented 3 years ago

@lazarostso

import undetected_chromedriver as uc
from seleniumwire import webdriver

chrome_options = webdriver.ChromeOptions()
chrome_options.headless = False
seleniumwire_options = {'proxy': {'https': 'type://host:port',}} #or type://username:password@host:port
driver = uc.Chrome(options=chrome_options, seleniumwire_options=seleniumwire_options)

driver.get('https://whatismyipaddress.com/')
ultrafunkamsterdam commented 3 years ago

I tested (and working also in v2):

In [4]: import undetected_chromedriver.v2 as uc

# ... some stuff to start proxies...

In [8]: proxypool.current_proxy_addr
Out[8]: ('127.0.0.1', 22225)

In [9]: opts = uc.ChromeOptions()
In [10]: opts.add_argument('--proxy-server=socks5://127.0.0.1:22225')
In [11]: driver = uc.Chrome(options=opts)
In [12]: driver.get('http://httpbin.org/ip')
In [13]: driver.page_source
Out[13]: '<html><head></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">{\n  "origin": "104.244.75.80"\n}\n</pre></body></html>'
In [14]: driver.quit()

In [15]: next(proxypool.pool)
Out[15]: ('127.0.0.1', 22226)
In [16]: opts = uc.ChromeOptions()
In [17]: opts.add_argument('--proxy-server=socks5://127.0.0.1:22226')
In [18]: driver = uc.Chrome(options=opts)
In [19]: driver.get('http://httpbin.org/ip')
In [20]: driver.page_source
Out[20]: '<html><head></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">{\n  "origin": "51.210.80.127"\n}\n</pre></body></html>'
merry75 commented 3 years ago

@ultrafunkamsterdam your example is not working when you want to use with username/password auth proxy

daruizr commented 3 years ago

@ultrafunkamsterdam your example is not working when you want to use with username/password auth proxy

I am also having the same problem, with an user and pass it's not working

Jamie4224 commented 3 years ago

@ultrafunkamsterdam I have the same problem, I can't get authenticated proxies to work, they give a credentials dialog. The extension method doesn't work, and the selenium wire method doesn't either.

sunny9495-dev commented 2 years ago

How to kill browser when using undetected chromedriver library, i use os.system("taskkill /F /IM chromedriver.exe /T") the chromedriver.exe is killing, but the browser is still appears

lazarostso commented 2 years ago

How to kill browser when using undetected chromedriver library, i use os.system("taskkill /F /IM chromedriver.exe /T") the chromedriver.exe is killing, but the browser is still appears

browser.quit() can do the job

nomorehumor commented 2 years ago

The solution given here seems not to work in ^3.1.0 anymore. And I find it bad, because exactly that version has given me a real anti bot protection on one website.