0

To disable proxy before launching chrome driver, Once chrome driver is launched proxy setting needs to be enabled.

in below Pre-req fun First proxy value is needs to be disabled in the end of pre-req fun proxy setting is to be enabled.

i have tested my whole script in another machine, that system has default proxy settings, so i cant able to launch chrome driver in that machine.

main thing is need to get proxy value directly from that machine without hardcode it, how to handle it

My chrome driver launch funtion:

def pre_req():
global driver,wait,finalPath,obj
finalPath=source+'\u005C'+"Extraction"+'\u005C'+obj
option = webdriver.ChromeOptions()
option.add_argument('--incognito')
prefs = {"download.default_directory": finalPath}
option.add_experimental_option("prefs", prefs)
s = Service("C:/Users/Public/DXS/drivers/chromedriver.exe")
opt = Options()
opt.add_argument("--lang=en")
driver = webdriver.Chrome(service=s, options=opt,chrome_options=option)
driver.implicitly_wait(300)
wait = WebDriverWait(driver, 300, poll_frequency=0.1)
driver.maximize_window()
Lechu
  • 33
  • 6

0 Answers0