diff --git a/constants/urls.py b/constants/urls.py index 51d175e..340621e 100644 --- a/constants/urls.py +++ b/constants/urls.py @@ -1,2 +1 @@ -CHROMEDRIVER_PATH = './chromedriver' RESUME_PATH = '/src/resume.png' diff --git a/main.py b/main.py index 5209c19..d7e000b 100644 --- a/main.py +++ b/main.py @@ -14,6 +14,9 @@ from resume_faker import make_resume from pdf2image import convert_from_path +from webdriver_manager.chrome import ChromeDriverManager +os.environ['WDM_LOG_LEVEL'] = '0' + from constants.common import * from constants.fileNames import * from constants.classNames import * @@ -26,7 +29,7 @@ os.environ["PATH"] += ":/usr/local/bin" # Adds /usr/local/bin to my path which is where my ffmpeg is stored fake = Faker() -chromedriver_location = CHROMEDRIVER_PATH + # Change default in module for print to flush # https://stackoverflow.com/questions/230751/how-can-i-flush-the-output-of-the-print-function-unbuffer-python-output#:~:text=Changing%20the%20default%20in%20one%20module%20to%20flush%3DTrue print = functools.partial(print, flush=True) @@ -112,7 +115,7 @@ def solveCaptcha(driver): driver.switch_to.default_content() def start_driver(random_city): - driver = webdriver.Chrome(chromedriver_location) + driver = webdriver.Chrome(ChromeDriverManager().install()) driver.get(CITIES_TO_URLS[random_city]) driver.implicitly_wait(10) time.sleep(2) diff --git a/requirements.txt b/requirements.txt index 992b66a..4371950 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,12 @@ -certifi==2021.5.30 -charset-normalizer==2.0.4 -idna==3.2 -requests==2.26.0 -selenium==3.141.0 -urllib3==1.26.6 -Faker==9.9.1 -fpdf==1.7.2 -pdf2image==1.16.0 -SpeechRecognition==3.8.1 -pydub==0.25.1 +certifi==2021.5.30 +charset-normalizer==2.0.4 +idna==3.2 +requests==2.26.0 +selenium==3.141.0 +urllib3==1.26.6 +Faker==9.9.1 +webdriver-manager==3.5.2 +fpdf==1.7.2 +pdf2image==1.16.0 +SpeechRecognition==3.8.1 +pydub==0.25.1