browser_manager: fix exception when closing chromedriver

master
EmaMaker 2022-02-17 15:33:10 +01:00
parent cd12419b47
commit ab63850d7f
2 changed files with 5 additions and 7 deletions

View File

@ -88,9 +88,9 @@ def close_browser(driver, tor_process):
tor_process.kill()
shutil.rmtree(get_tor_data_dir())
shutil.rmtree(get_chrome_data_dir())
try:
driver.close()
except:
print("[INFO] Undetected chromedriver threw the usual exception while closing, exiting")
driver.quit()
except Exception as e:
print("[INFO] Undetected chromedriver threw exception while closing, exiting. Exception:", e)
shutil.rmtree(get_chrome_data_dir())

View File

@ -48,8 +48,6 @@ def visit_page(driver, url):
time.sleep(4)
break
driver.quit()
def try_to_click_elements(driver, clickable_elements):
while True:
if len(clickable_elements) == 0: