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}')