From c8842759b790c45365a8d420195be07fbce92cfa Mon Sep 17 00:00:00 2001 From: emamaker Date: Sat, 5 Feb 2022 09:45:35 +0100 Subject: [PATCH] chromedriver: use binary location --- browser_manager.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/browser_manager.py b/browser_manager.py index a3f2031..baccd00 100644 --- a/browser_manager.py +++ b/browser_manager.py @@ -47,6 +47,10 @@ def create_tor_proxy(socks_port, control_port): return tor_process def start_browser(use_tor=False, headless=False): + os.mkdir(get_chrome_data_dir()) + + shutil.copy('/usr/bin/chromedriver', './'+get_chrome_data_dir()) + options = uc.ChromeOptions() if headless: @@ -70,8 +74,8 @@ def start_browser(use_tor=False, headless=False): options.add_argument(f'--proxy-server=socks5://localhost:{SOCKS_PORT}') else: proxies = [] - - driver=uc.Chrome(options=options) + + driver = uc.Chrome(options=options, chromedriver_executable_path=get_chrome_data_dir()+'/chromedriver') ip = requests.get("http://httpbin.org/ip", proxies=proxies).json()["origin"] print (f'IP is {ip}')