4

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.

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?

This is the site https://www.myexternalip.com/raw : With undetected chromedriver (gives my actual ip)

ip adress

Thanks for your help.

2
  • Check out the answer from the other thread here Commented Apr 3, 2022 at 18:18
  • @NaphatTheerawat its not about authentication, its about making the proxy work with undetected-chromedriver Commented Apr 3, 2022 at 22:51

3 Answers 3

0

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')
Sign up to request clarification or add additional context in comments.

1 Comment

It's the same as in question
-1

You can use a chrome extension to change your IP using a proxy. For example I use SwitchyOmega. Then I set the proxy inside the extension and it works completely fine.

Comments

-2

I assume you set up a green flag for your machine on your server, so you don't need to enter the login and password for the server:

options.add_argument('--proxy-server=185.195.81.152:12573') 
options.add_argument('--proxy-server=socks5://185.195.81.152:12573') # socks5
options.add_argument('--proxy-server=https://185.195.81.152:12573') # https

also suggest using:

options.add_argument('--proxy-bypass-list=<-loopback>')

If you didn't green flag your machines IP to the server, then you'll need to provide the login and password as well:

options.add_argument('--proxy-server=proxy_username:proxy_password@proxy_ip:proxy_port')

1 Comment

The only valid option in this answer is --proxy-server=185.195.81.152:12573. The rest won't work in any chromium based browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.