nicolomantini / LinkedIn-Easy-Apply-Bot

Automate the application process on LinkedIn
Apache License 2.0
732 stars 307 forks source link

Instant crash after login #152

Closed 4cecoder closed 3 months ago

4cecoder commented 6 months ago

Describe the bug Bot crashes right after login

Logs If applicable, attach your logs file found in ./logs/

Error Statement

Traceback (most recent call last):
  File "/Users/fource/bytecats/LinkedIn-Easy-Apply-Bot/easyapplybot.py", line 633, in <module>
    bot = EasyApplyBot(parameters['username'],
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/fource/bytecats/LinkedIn-Easy-Apply-Bot/easyapplybot.py", line 85, in __init__
    self.start_linkedin(username, password)
  File "/Users/fource/bytecats/LinkedIn-Easy-Apply-Bot/easyapplybot.py", line 167, in start_linkedin
    oneclick_auth = self.browser.find_element(by='id', value='reset-password-submit-button')
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/fource/bytecats/LinkedIn-Easy-Apply-Bot/venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 741, in find_element
    return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/fource/bytecats/LinkedIn-Easy-Apply-Bot/venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute
    self.error_handler.check_response(response)
  File "/Users/fource/bytecats/LinkedIn-Easy-Apply-Bot/venv/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="reset-password-submit-button"]"}
  (Session info: chrome=121.0.6167.139); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception

Desktop (please complete the following information):

To Reproduce Steps to reproduce the behavior:

  1. Go to python3 -m venv venv && source /venv/bin/activate && pip install -r requirements.txt && python easyapply.py
  2. Opens chrome
  3. Logs in and it's successful, then crashes

Expected behavior Expected to go to the jobs URL after login and start auto applying

Additional context Add any other context about the problem here.

Kidus-berhanu commented 5 months ago

Hi, @4cecoder did you figure out a solution for this ? i tried using from selenium.webdriver.support.ui import WebDriverWait try.catch but it didint help try: oneclick_auth = WebDriverWait(self.browser, 10).until( EC.presence_of_element_located((By.ID, 'reset-password-submit-button')) ) except TimeoutException: print("The element 'reset-password-submit-button' was not found within the timeout period.")

and 
i though the web page's structure may be  changed or if the element is not yet loaded when Selenium attempts to find it. 
and i checked that and it didn't change.
4cecoder commented 5 months ago

Hi, @4cecoder did you figure out a solution for this ? i tried using from selenium.webdriver.support.ui import WebDriverWait try.catch but it didint help try: oneclick_auth = WebDriverWait(self.browser, 10).until( EC.presence_of_element_located((By.ID, 'reset-password-submit-button')) ) except TimeoutException: print("The element 'reset-password-submit-button' was not found within the timeout period.")

and 
i though the web page's structure may be  changed or if the element is not yet loaded when Selenium attempts to find it. 
and i checked that and it didn't change.

I was never able to find a good workaround for this at all

ba2512005 commented 5 months ago

should be fixed in new PR https://github.com/nicolomantini/LinkedIn-Easy-Apply-Bot/pull/154

github-actions[bot] commented 3 months ago

Stale issue message