0

I am trying to launch a url using selenium and python.
Without logging into zscalar proxy I get "This site can’t be reached" on the browser.
The browser does launch.

I am able to authenticate using python requests, but I am not able to get the syntax right for selenium. Here is the code, it does not work.

proxyList =['http://onlineuser:sillypassword@xscaler.someplace.com:10077']

chromeOptions = webdriver.ChromeOptions()
chromeOptions.add_argument('--proxy-server={}'.format(random.choice(proxyList)))
driver = webdriver.Chrome(executable_path="chromedriver.exe", chrome_options=chromeOptions)
driver.get("https://somewebsite.com")

But the following code works fine (python requests)

proxy_data = {'http': 'http://onlineuser:sillypassword@xscaler.someplace.com:10077',
              'https': 'http://onlineuser:sillypassword@xscaler.someplace.com:10077'}

    response = requests.post(url, headers=headers, data=payload_limited, proxies=proxy_data)
furas
  • 134,197
  • 12
  • 106
  • 148
john
  • 1
  • always put full error message (starting at word "Traceback") in question (not in comments) as text (not screenshot, not link to external portal). There are other useful information. – furas Mar 11 '22 at 13:22
  • browsers from time to time change settings and sometimes old arguments does't work. – furas Mar 11 '22 at 13:25
  • is browser working with this proxy when you set proxy directly in Chrome's settings (using GUI instead of `--proxy-server`)? – furas Mar 11 '22 at 13:26
  • Ok, I checked on how to set proxy permissions on settings. It did not help due to some access permission issues. Right now I am logging into proxy using selenium, which is not ideal. – john Mar 15 '22 at 11:44

0 Answers0