diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..64a5042 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ + +*.exe + +.idea/ + +config.json + +debug.log + +test.py + +.vscode \ No newline at end of file diff --git a/main.py b/main.py index 0232efa..734b8f9 100644 --- a/main.py +++ b/main.py @@ -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'""" @@ -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): @@ -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) self.close_session()