NathanDuma / LinkedIn-Easy-Apply-Bot

Automate LinkedIn Easy Apply job applications and answer application-specific questions.
223 stars 84 forks source link

javascript error: arguments[0].scrollTo is not a function #41

Open Citizen3rased opened 2 years ago

Citizen3rased commented 2 years ago

Going to job page 0 Starting the application process for this page... Traceback (most recent call last): File "C:\Users\bob\Documents\python_workspace\LinkedIn-Easy-Apply-Bot\linkedineasyapply.py", line 125, in apply_jobs self.scroll_slow(job_results) File "C:\Users\bob\Documents\python_workspace\LinkedIn-Easy-Apply-Bot\linkedineasyapply.py", line 677, in scroll_slow self.browser.execute_script("arguments[0].scrollTo(0, {})".format(i), scrollable_element) File "C:\Users\bob\AppData\Roaming\Python\Python310\site-packages\selenium\webdriver\remote\webdriver.py", line 493, in execute_script return self.execute(command, { File "C:\Users\bob\AppData\Roaming\Python\Python310\site-packages\selenium\webdriver\remote\webdriver.py", line 435, in execute self.error_handler.check_response(response) File "C:\Users\bob\AppData\Roaming\Python\Python310\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.JavascriptException: Message: javascript error: arguments[0].scrollTo is not a function

Receiving this error after it gets to the job listing page. Jobs show up on the page, but the applying phase never starts. To get to this point I had to apply the fixes for find_elements. My code now looks like this:

try: job_results = self.browser.find_elements(By.CLASS_NAME, "jobs-search-results") self.scroll_slow(job_results) self.scroll_slow(job_results, step=300, reverse=True)

Citizen3rased commented 2 years ago

Turned out this error was caused by my typo of find_elements instead of find_element. After fixing this mistake, I was getting another error:

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".jobs-search-results"}

A search of the job page found no class named jobs-search-results. It looks like this was changed to jobs-search-results-list After changing the class name, I no longer get this error.

logix727 commented 2 years ago

can you share working setup plz

OakandRocks commented 1 year ago

Replacing all jobs-search-results to jobs-search-results-list gives me a chromedriver.exe error (cant find file)