Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,13 @@ On mac/pc:

`pip install -r requirements.txt`

You will probably need to go get the chrome driver to make selenium work, as they are version-specific. The one in the repo might not do it for you. Find your chrome version by going to **Chrome** >> **About Google Chrome**.
This will install `webdriver-manager` to automatically download the correct chrome driver. If you are having issues opening having it open chrome, check https://github.com/SergeyPirogov/webdriver_manager.

This will open a tab that shows you your verison. Visit https://sites.google.com/chromium.org/driver/downloads and download the driver for your version.

folder. Extract the downloaded zip file. Move the extracted chromedriver binary to this project folder

`mv ~/Downloads/chromedriver .`

It needs to be found in your `PATH` variable.

`export PATH=$PATH:$(pwd)`
# Run

`python req.py` to run. It will loop until you kill the job. `ctrl + c` in your terminal to give the pro lifes a break (optional).

mac:
# Chrome drivers on MacOS

You might also get a trust issue with the downloaded driver being unverified. To fix that, run

Expand Down
1 change: 0 additions & 1 deletion constants/urls.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
CHROMEDRIVER_PATH = './chromedriver'
RESUME_PATH = '/src/resume.png'
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from selenium import webdriver
from selenium.webdriver.support.ui import Select

from webdriver_manager.chrome import ChromeDriverManager

from constants.common import *
from constants.elementIds import *
from constants.email import *
Expand All @@ -16,14 +18,13 @@
from constants.xPaths import *

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)


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)
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ idna==3.2
requests==2.26.0
selenium==3.141.0
urllib3==1.26.6
Faker==9.9.1
Faker==9.9.1
webdriver-manager==3.5.2