2

I have already tried: '''

from selenium import webdriver

PROXY = "23.23.23.23:3128" # IP:PORT or HOST:PORT

options = webdriver.ChromeOptions()
options.add_argument('--proxy-server=%s' % PROXY)

chrome = webdriver.Chrome('./chromedriver',options=options) #<----- I used './chromedriver' to set a PATH
chrome.get("http://whatismyipaddress.com")

''' The above code is taken from how do i set proxy for chrome in python webdriver.

I am getting an error from google chrome saying ERR_NO_SUPPORTED_PROXIES, even when I am using public ones.

Floaters
  • 33
  • 1
  • 4
  • Does this answer your question? [How to use authenticated proxy in selenium chromedriver?](https://stackoverflow.com/questions/30451190/how-to-use-authenticated-proxy-in-selenium-chromedriver) – AMC Apr 23 '20 at 23:58

1 Answers1

2

you can try this:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

PROXY = "23.23.23.23:3128" # IP:PORT or HOST:PORT

capabilities = dict(DesiredCapabilities.CHROME)
capabilities['proxy'] = {'proxyType': 'MANUAL','httpProxy': '23.23.23.23:3128','ftpProxy': '23.23.23.23:3128','sslProxy': '23.23.23.23:3128','noProxy': '','class': "org.openqa.selenium.Proxy",'autodetect': False}
chrome_options = Options()
chrome_options.add_argument("--disable-notifications")
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--verbose')
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument('--disable-software-rasterizer')
chrome_options.add_argument('--headless')
chrome = webdriver.Chrome('./chromedriver',options=chrome_options) #<----- I used './chromedriver' to set a PATH
chrome.get("http://whatismyipaddress.com")
Sho_Lee
  • 149
  • 4