Skip to content

Commit

Permalink
fixed bug with expire in cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
eracle committed Sep 27, 2020
1 parent 45e6d2f commit 5d44d5d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions linkedin/spiders/selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ def init_chromium(selenium_host, cookies=None):
driver = webdriver.Remote(command_executor=selenium_url,
desired_capabilities=chrome_options)

if cookies is not None:
if cookies:
driver.get("https://www.linkedin.com/404error")
for cookie in cookies:
if 'expiry' in cookie:
del cookie['expiry']
driver.add_cookie(cookie)

return driver
Expand All @@ -128,4 +130,4 @@ def login(driver):
print('Searching for the submit')
get_by_xpath(driver, '//*[@type="submit"]').click()

return driver.get_cookies()
return driver.get_cookies()

0 comments on commit 5d44d5d

Please sign in to comment.