From e9b29282991a0173de9f20c023583817b057b78e Mon Sep 17 00:00:00 2001 From: snowcatridge10 Date: Sat, 3 Jun 2023 18:14:29 -0400 Subject: [PATCH] Add chromedrivermanager --- main.py | 8 ++------ requirements.txt | 3 ++- static/img/magnifying-glass-solid.svg | 1 + 3 files changed, 5 insertions(+), 7 deletions(-) create mode 100644 static/img/magnifying-glass-solid.svg diff --git a/main.py b/main.py index 0a0d45e..5f92661 100644 --- a/main.py +++ b/main.py @@ -18,6 +18,7 @@ from traceback import print_exc from requests_html import HTMLSession from argparse import ArgumentParser import os +from webdriver_manager.chrome import ChromeDriverManager debugmode = False @@ -62,12 +63,7 @@ instance_root_url = "http://127.0.0.1:8002" chrome_options = Options() chrome_options.add_argument("--headless") -if os.name == 'nt': - # Windows - driver = webdriver.Chrome('./chromedriver.exe', options=chrome_options) -else: - # Linux - driver = webdriver.Chrome('./chromedriver', options=chrome_options) +driver = webdriver.Chrome(ChromeDriverManager().install(), options=chrome_options) channels = [] diff --git a/requirements.txt b/requirements.txt index 56aa84d..635179a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ bs4 requests flask selenium -requests_html \ No newline at end of file +requests_html +webdriver-manager \ No newline at end of file diff --git a/static/img/magnifying-glass-solid.svg b/static/img/magnifying-glass-solid.svg new file mode 100644 index 0000000..ee25f3c --- /dev/null +++ b/static/img/magnifying-glass-solid.svg @@ -0,0 +1 @@ + \ No newline at end of file