Skip to content

Commit

Permalink
Dark mode added
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabo_Tech committed Jul 11, 2024
1 parent f9fd28a commit 7c349db
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class EasyApplyLinkedin:
}

LOCATION_MAPPING = {
"Texas":"102748797",
"Canada": "101174742",
"Portugal": "100364837",
"Switzerland": "106693272",
Expand Down Expand Up @@ -178,6 +179,16 @@ def login_linkedin(self):
"""Log in to LinkedIn using the provided credentials."""
try:
self.driver.get("https://www.linkedin.com/login")
self.driver.add_cookie({
'name': 'li_theme',
'value': 'dark',
'domain': '.linkedin.com',
'path': '/',
'expires': int(time.time() + 365 * 24 * 60 * 60),
'secure': True,
'httpOnly': False
})
self.driver.refresh()
WebDriverWait(self.driver, 10).until(
EC.presence_of_element_located((By.NAME, "session_key"))
)
Expand Down Expand Up @@ -247,8 +258,12 @@ def job_search(self):
def construct_url(self):
"""Construct the URL for job search with applied filters."""
current_location = self.locations[self.current_location_index]
keywords_query = f'({self.keywords})'
keywords_to_avoid_query = f'NOT ({self.keywords_to_avoid})'
combined_keywords = f'{keywords_query} {keywords_to_avoid_query}'

params = {
"keywords": f"({self.keywords}) NOT ({self.keywords_to_avoid})",
"keywords": combined_keywords,
"origin": "JOB_SEARCH_PAGE_JOB_FILTER",
"refresh": "true",
"sortBy": self.sort_by,
Expand Down Expand Up @@ -691,4 +706,4 @@ def handle_captcha(self):
bot.login_linkedin()
bot.job_search()
bot.find_offers()
bot.close_session()
bot.close_session()

0 comments on commit 7c349db

Please sign in to comment.