voidbydefault / EasyApplyBot

Bot for applying jobs using LinkedIn Easy Apply feature on LinkedIn
GNU General Public License v3.0
40 stars 28 forks source link

Failed to apply to job! #36

Closed hsspratt closed 11 months ago

hsspratt commented 11 months ago

I have been receiving this message all after the following error message was produced multiple times before printing "Failed to apply to job! Please submit a bug report with this link".

Here are some of the ones from the last round:

Failed to apply to job! Please submit a bug report with this link: https://www.linkedin.com/jobs/view/3736280516/
Failed to apply to job! Please submit a bug report with this link: https://www.linkedin.com/jobs/view/3746595422/
Failed to apply to job! Please submit a bug report with this link: https://www.linkedin.com/jobs/view/3747706325/
Failed to apply to job! Please submit a bug report with this link: https://www.linkedin.com/jobs/view/3747487107/
Failed to apply to job! Please submit a bug report with this link: https://www.linkedin.com/jobs/view/3743856867/

No error is produced for these specific jobs although when it changed to another page (page 3) the following error was produced:


Traceback (most recent call last):
  File "/Users/harold/EasyApplyBot/linkedineasyapply.py", line 195, in apply_jobs
    job_el = job_tile.find_element(By.CLASS_NAME, 'job-card-list__title')
  File "/Users/harold/EasyApplyBot/venv/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 416, in find_element
    return self._execute(Command.FIND_CHILD_ELEMENT, {"using": by, "value": value})["value"]
  File "/Users/harold/EasyApplyBot/venv/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 394, in _execute
    return self._parent.execute(command, params)
  File "/Users/harold/EasyApplyBot/venv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 344, in execute
    self.error_handler.check_response(response)
  File "/Users/harold/EasyApplyBot/venv/lib/python3.9/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":".job-card-list__title"}
  (Session info: chrome=118.0.5993.117); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
0   chromedriver                        0x0000000104bcce08 chromedriver + 5025288
1   chromedriver                        0x0000000104bc3c23 chromedriver + 4987939
2   chromedriver                        0x0000000104765e67 chromedriver + 409191
3   chromedriver                        0x00000001047b51b9 chromedriver + 733625
4   chromedriver                        0x00000001047b5371 chromedriver + 734065
5   chromedriver                        0x00000001047a8b66 chromedriver + 682854
6   chromedriver                        0x00000001047dc50d chromedriver + 894221
7   chromedriver                        0x00000001047a8a28 chromedriver + 682536
8   chromedriver                        0x00000001047dc69e chromedriver + 894622
9   chromedriver                        0x00000001047f8571 chromedriver + 1009009
10  chromedriver                        0x00000001047dc2b3 chromedriver + 893619
11  chromedriver                        0x00000001047a6eb9 chromedriver + 675513
12  chromedriver                        0x00000001047a80ee chromedriver + 680174
13  chromedriver                        0x0000000104b8e819 chromedriver + 4769817
14  chromedriver                        0x0000000104b93893 chromedriver + 4790419
15  chromedriver                        0x0000000104b9a66e chromedriver + 4818542
16  chromedriver                        0x0000000104b945bd chromedriver + 4793789
17  chromedriver                        0x0000000104b6698c chromedriver + 4606348
18  chromedriver                        0x0000000104bb2b78 chromedriver + 4918136
19  chromedriver                        0x0000000104bb2d30 chromedriver + 4918576
20  chromedriver                        0x0000000104bc385e chromedriver + 4986974
21  libsystem_pthread.dylib             0x00007ff818170202 _pthread_start + 99
22  libsystem_pthread.dylib             0x00007ff81816bbab thread_start + 15

Starting the application process for this page...
Applying to the job....
Failed to apply to job! Please submit a bug report with this link: https://www.linkedin.com/jobs/view/3749511825/

After which it failed to apply successfully for a job so assuming it is related.

voidbydefault commented 11 months ago

Thanks @hsspratt. Is it unable to apply at all? But, let me investigate this.

hsspratt commented 11 months ago

Never starts off with the error with me. It always applies for some jobs successfully before producing the error. Haven't reproduced the exact same error but almost identical today.

The successful prints:

Starting the search for Venture Capital Analyst in London.
Going to job page 0
Starting the application process for this page...
Already applied to the job!
Already applied to the job!
Already applied to the job!
Applying to the job....
Failed to upload resume or cover letter!
Done applying to the job!
Applying to the job....
Failed to upload resume or cover letter!
Done applying to the job!
Applying to the job....
Failed to upload resume or cover letter!
Done applying to the job!
Already applied to the job!
Already applied to the job!
Already applied to the job!
Already applied to the job!
Applying to the job....
Failed to upload resume or cover letter!
Done applying to the job!

**_... lots in between_**

Applying to the job....
Failed to apply to job! Please submit a bug report with this link: https://www.linkedin.com/jobs/view/3746269605/
Writing to the failed csv file...
Could not apply to the job!

Traceback (most recent call last):
  File "/Users/harold/EasyApplyBot/linkedineasyapply.py", line 195, in apply_jobs
    job_el = job_tile.find_element(By.CLASS_NAME, 'job-card-list__title')
  File "/Users/harold/EasyApplyBot/venv/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 416, in find_element
    return self._execute(Command.FIND_CHILD_ELEMENT, {"using": by, "value": value})["value"]
  File "/Users/harold/EasyApplyBot/venv/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 394, in _execute
    return self._parent.execute(command, params)
  File "/Users/harold/EasyApplyBot/venv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 344, in execute
    self.error_handler.check_response(response)
  File "/Users/harold/EasyApplyBot/venv/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: disconnected: not connected to DevTools
  (failed to check if window was closed: disconnected: not connected to DevTools)
  (Session info: chrome=119.0.6045.105)
Stacktrace:
0   chromedriver                        0x0000000107166d28 chromedriver + 4795688
1   chromedriver                        0x000000010715e2b3 chromedriver + 4760243
2   chromedriver                        0x0000000106d3788d chromedriver + 407693
3   chromedriver                        0x0000000106d1c67e chromedriver + 296574
4   chromedriver                        0x0000000106d1c573 chromedriver + 296307
5   chromedriver                        0x0000000106d3a052 chromedriver + 417874
6   chromedriver                        0x0000000106dc9117 chromedriver + 1003799
7   chromedriver                        0x0000000106dada73 chromedriver + 891507
8   chromedriver                        0x0000000106d78143 chromedriver + 672067
9   chromedriver                        0x0000000106d7931e chromedriver + 676638
10  chromedriver                        0x0000000107127795 chromedriver + 4536213
11  chromedriver                        0x000000010712c853 chromedriver + 4556883
12  chromedriver                        0x000000010710d001 chromedriver + 4427777
13  chromedriver                        0x000000010712d59d chromedriver + 4560285
14  chromedriver                        0x00000001070fe48c chromedriver + 4367500
15  chromedriver                        0x000000010714d0e8 chromedriver + 4690152
16  chromedriver                        0x000000010714d29e chromedriver + 4690590
17  chromedriver                        0x000000010715deee chromedriver + 4759278
18  libsystem_pthread.dylib             0x00007ff810ed3202 _pthread_start + 99
19  libsystem_pthread.dylib             0x00007ff810ecebab thread_start + 15
voidbydefault commented 11 months ago

Hi @hsspratt ,

Please use code tags (those < > in editor window) to keep the thread tidy (I have edited your posts to do the same). About your issue:

  1. I am unable to reproduce the error even after setting-up the bot from scratch.

  2. Based on below, I suspect your Internet to be the issue for not loading the webpage (or element in this case) before the bot attempts a search for it.

 job_el = job_tile.find_element(By.CLASS_NAME, 'job-card-list__title')
.../venv/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 416, in find_element
return self._execute(Command.FIND_CHILD_ELEMENT, {"using": by, "value": value})["value"]
... and so on
  1. Although no one has reported the error, I am making a small change of adding a 2-seconds delay to allow loading of all elements so lag-related errors could be prevented. Downside, further slows down the bot.

  2. I will be updating code on Github after 2-second delay testing goes without issues.

  3. My run so far:

Starting the search for finance manager in Australia and New Zealand.
Going to job page 0
Starting the application process for this page...
Job contains blacklisted keyword or company or poster name!
Applying to the job....
Failed to upload resume or cover letter!
Done applying to the job!
Applying to the job....
Failed to upload resume or cover letter!
Done applying to the job!
Applying to the job....
Failed to upload resume or cover letter!
Done applying to the job!
Applying to the job....
Failed to upload resume or cover letter!
Done applying to the job!
Already applied to the job!
Applying to the job....
Failed to upload resume or cover letter!
Failed to upload resume or cover letter!
Done applying to the job!
Applying to the job....
Failed to upload resume or cover letter!
Done applying to the job!
Applying to the job....
Failed to upload resume or cover letter!
Done applying to the job!
Applying to the job....
Failed to upload resume or cover letter!
Done applying to the job!
Applying to the job....
Failed to upload resume or cover letter!
Done applying to the job!
Applying to the job....
Failed to upload resume or cover letter!
Done applying to the job!
Applying to the job....
Starting the search for treasury manager in Canada.
Going to job page 0
Starting the application process for this page...
Applying to the job....
Done applying to the job!
Applying to the job....
Done applying to the job!
Job contains blacklisted keyword or company or poster name!
  1. With this, I am also supressing that annoying "Failed to upload..." (no longer serves the purpose).
voidbydefault commented 11 months ago

@hsspratt I have pushed changes, please download new linkedineasyapply.py and main.py to replcae your current local versions.

Hope this helps. Closing.