Answer the question
In order to leave comments, you need to log in
How to use proxy with authorization in selenium?
I have this code:
import os
from seleniumwire import webdriver
import json
class Starting:
def __init__(self):
self.proxy = f"http://C0HDCd:[email protected]:8000"
def driver_load(self):
options = webdriver.ChromeOptions()
options.add_argument(f'user-data-dir={os.getcwd()}') # data[cookies] load
proxy = {
"proxy": {
"https": self.proxy
}
}
return webdriver.Chrome(executable_path=f'{os.getcwd()}/chromedriver.exe',
seleniumwire_options=proxy)
def start(self):
driver = self.driver_load()
driver.get('https://myip.ru/')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question