chromedriver: use binary location

master
emamaker 2022-02-05 09:45:35 +01:00
parent 913b5d0ee3
commit c8842759b7
1 changed files with 6 additions and 2 deletions

View File

@ -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:
@ -71,7 +75,7 @@ def start_browser(use_tor=False, headless=False):
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}')