NathanDuma / LinkedIn-Easy-Apply-Bot

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

Can't find a job to apply to #51

Closed xMacJ closed 1 year ago

xMacJ commented 1 year ago

The script can't seem to find the first job after searching for a keyword. It get stuck and goes to sleep for over 800 seconds. Is anyone else having this issue?

xMacJ commented 1 year ago

image

secretgrampuh commented 1 year ago

Did you already do this?

https://github.com/NathanDuma/LinkedIn-Easy-Apply-Bot/commit/1f55089677aea5c364e94c6ca5db9854a3609572

It updates deprecated selenium commands

But I see in your error message it looks like you're using the correct selenium methods.... Hmmm

xMacJ commented 1 year ago

I have made the above-linked changes, but the script still can't find a job to apply too and the same error remains

nopmop commented 1 year ago

@xMacJ after applying the change that @secretgrampuh told you to apply, just change these lines:

123         try:
124             job_results = self.browser.find_element_by_class_name("jobs-search-results")
125             self.scroll_slow(job_results)
126             self.scroll_slow(job_results, step=300, reverse=True)
127 
128             job_list = self.browser.find_elements_by_class_name('jobs-search-results__list')[0].find_elements_by_class_name('jobs-search-results__list-item')
129         except:

into this:

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

            job_list = self.browser.find_elements(By.CLASS_NAME, 'jobs-search-results-list')[0].find_elements(By.CLASS_NAME, 'jobs-search-results__list-item')
        except:

It willl work. Cheers!

xMacJ commented 1 year ago

@nopmop Thank you for the quick response on this issue. It seems as there is another issue after this code change. The script applies to one job and can't seem apply to any more. After the first applied job the script throws an error and goes to sleep. image

nopmop commented 1 year ago

@xMacJ that error in selenium means that the element can't be found in the DOM. It's easy to fix: just reassign the element by find()'ing it again. Note: I think your error is due to your version of Selenium and/or Chrome (on my setup with Selenium 4.1.0 and Chrome 96 it works flawlessly). However, after your reply I monitored a bit what the bot does (which I hadn't done before) I've found that it has some bugs that may easily get your application rejected (i.e. it selects that you're not legally authorized to work when there's a pull-down menu, not a radio-button choice). Be careful!

xMacJ commented 1 year ago

@nopmop How can I find that element? I also attempted to downgrade chrome to your version and still get the same issue so it must be selenium.

nopmop commented 1 year ago

@xMacJ did you manage to fix it? If not, tell me your setup, I'll try to reproduce your bug. Maybe I'll write a full PR this weekend.

xMacJ commented 1 year ago

@nopmop You are the true hero of all job searchers! I'm still facing the same issues after making the above-mentioned changes. The script applies to one job and then breaks, unable to find other positions. I am running Windows 10 using Selenium v 4.5.0 and Chrome 96 (which I downgraded to match yours). I also noticed some of the issues you monitored, such as entering zeros on required fields or selecting you are not legally authorized to work.

nopmop commented 1 year ago

@xMacJ I fixed it for you. It's all included in PR #52 (or if you prefer you can clone from my fork), tested on Linux as well as on Windows10 with Selenium 4.5.0 and Chrome 106.0.5249.119 -- should be okay. Don't forget to close the issue. Cheers.