Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function update #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

*.exe

.idea/

config.json

debug.log

test.py

.vscode
32 changes: 21 additions & 11 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,22 @@ def job_search(self):
jobs_link = self.driver.find_element_by_link_text('Jobs')
jobs_link.click()

# wait until its fully load
time.sleep(5)

# search based on keywords and location and hit enter
search_keywords = self.driver.find_element_by_css_selector(".jobs-search-box__text-input[aria-label='Search jobs']")
search_keywords.clear()
search_keywords.send_keys(self.keywords)
search_location = self.driver.find_element_by_css_selector(".jobs-search-box__text-input[aria-label='Search location']")
search_location.clear()
search_location.send_keys(self.location)
search_location.send_keys(Keys.RETURN)
search_keywords = self.driver.find_elements_by_css_selector(
".jobs-search-box__text-input")

# job keyword
search_keywords[0].clear()
search_keywords[0].send_keys(self.keywords)

# job location
search_keywords[2].clear()
search_keywords[2].send_keys(self.location)
search_keywords[2].send_keys(Keys.RETURN)


def filter(self):
"""This function filters all the job results by 'Easy Apply'"""
Expand All @@ -58,10 +66,12 @@ def filter(self):
all_filters_button = self.driver.find_element_by_xpath("//button[@data-control-name='all_filters']")
all_filters_button.click()
time.sleep(1)
easy_apply_button = self.driver.find_element_by_xpath("//label[@for='f_LF-f_AL']")
easy_apply_button = self.driver.find_element_by_xpath("//label[@for='linkedinFeatures-f_AL']")
easy_apply_button.click()
time.sleep(1)
apply_filter_button = self.driver.find_element_by_xpath("//button[@data-control-name='all_filters_apply']")
apply_filter_button = self.driver.find_element_by_xpath(
"//button[@class='search-advanced-facets__button--apply ml4 mr2 artdeco-button artdeco-button--3 "
"artdeco-button--primary ember-view']")
apply_filter_button.click()

def find_offers(self):
Expand Down Expand Up @@ -165,8 +175,8 @@ def apply(self):
time.sleep(5)
self.filter()
time.sleep(2)
self.find_offers()
time.sleep(2)
# self.find_offers()
# time.sleep(2)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

self.close_session()


Expand Down