0

I am trying to access a url using proxy authentication whith username and password.

I have found a package which uses proxy authentication: selenium-wire on https://github.com/wkeeling/selenium-wire

I have written the following code

from seleniumwire import webdriver

df_proxies=WebShare_Proxies()
args=df_proxies.values[random.choice(df_proxies.index)].tolist()

proxy_ip,proxy_port,username,password=args

url='https://fra.privateinternetaccess.com/pages/whats-my-ip/'

proxyString=username+":"+password+"@"+str(proxy_ip)+":"+str(proxy_port)

options = {
'proxy': {
    'http': 'http://'+proxyString,
    'https': 'https://'+proxyString,
    'no_proxy': 'localhost,127.0.0.1'
    }
}

driver = webdriver.Firefox(seleniumwire_options=options)

WebShare_Proxies() calls https://www.webshare.io/ API to get my proxies list My proxy uses username and password for authentication

proxyString
'$myusername:$mypassword@45.95.96.187:8746'

I am having the following error when calling webdriver.Firefox(seleniumwire_options=options)

...in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process

Anyone has a clue how to overcome this error ?

Thank you for you consideration

Reda E.
  • 79
  • 5

0 Answers0