joaosilvalopes / linkedin-easy-apply-bot

MIT License
174 stars 65 forks source link

error on apply #24

Closed tripshed closed 1 year ago

tripshed commented 1 year ago

cmd: npm run apply

scripts@1.0.0 apply node ./scripts/apply.js SUBMIT

Logged in to LinkedIn press enter to pause the program \linkedin-easy-apply-bot-main\linkedin-easy-apply-bot-main\node_modules\puppeteer-core\lib\cjs\puppeteer\common\WaitTask.js:63 this.terminate(new Errors_js_1.TimeoutError(Waiting failed: ${options.timeout}ms exceeded)); ^

TimeoutError: Waiting for selector .jobs-search-results-list li.jobs-search-results__list-item:nth-child(7) failed: Waiting failed: 5000ms exceeded at Timeout. (linkedin-easy-apply-bot-main\linkedin-easy-apply-bot-main\node_modules\puppeteer-core\lib\cjs\puppeteer\common\WaitTask.js:63:32) at listOnTimeout (node:internal/timers:569:17) at process.processTimers (node:internal/timers:512:7)

Node.js v18.15.0

joaosilvalopes commented 1 year ago

I just tested the command and couldn't reproduce the issue, it could have something to do with your internet speed, if the jobs in the listing take more than 5 seconds to load it throws an error.

Can you try to change the timeout on fetch/fetchJobLinksUser.js line 27 where it says { timeout: 5000 } and change it to some higher value like { timeout: 10000 } and tell me if it works?

tripshed commented 1 year ago

Yep, same thing. Not the internet. It is stuck on the jobs listing page and exits.

npm run apply


> scripts@1.0.0 apply
> node ./scripts/apply.js SUBMIT

Logged in to LinkedIn
press enter to pause the program
\linkedin-easy-apply-bot-main\node_modules\puppeteer-core\lib\cjs\puppeteer\common\WaitTask.js:63
                this.terminate(new Errors_js_1.TimeoutError(`Waiting failed: ${options.timeout}ms exceeded`));
                               ^

TimeoutError: Waiting for selector `.jobs-search-results-list li.jobs-search-results__list-item:nth-child(7)` failed: Waiting failed: 10000ms exceeded
    at Timeout.<anonymous> (\linkedin-easy-apply-bot-main\node_modules\puppeteer-core\lib\cjs\puppeteer\common\WaitTask.js:63:32)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7)

Node.js v18.15.0
joaosilvalopes commented 1 year ago

Can you send me a print screen of the chromium browser where the bot is running? To do this add await wait(100000); right before line 27 and take a print screen once its there

joaosilvalopes commented 1 year ago

I am currently troubleshooting with another guy that had the same problem

joaosilvalopes commented 1 year ago

Are you using windows? It seems on windows linkedin is only showing one job per job listing page (it must have something to do with chrome vs chromium), i'll have access to a windows computer tomorrow and troubleshoot this.

Thanks for reporting!

joaosilvalopes commented 1 year ago

Seems its not windows, i just tested on Windows 11 and it worked fine if you can send the print it would be appreciated

tripshed commented 1 year ago

Yes, I'm on windows. Tried it on ubuntu as well. Same result. Looks like it's unable to find an element on linkedin? Here is a screen print. It comes to the jobs page and times out https://i.ibb.co/vvpBD9b/image.png

joaosilvalopes commented 1 year ago

Yeah the error message is saying it's not finding the 7th job in the listing page, although your page seems to have all the jobs.

Once it's on the page can you do inspect right click the html element and then press copy -> outerhtml and paste it here, so I can debug?

joaosilvalopes commented 1 year ago

I'd be happy if you are able to troubleshoot this with me as i couldn't yet reproduce it @tripshed

joaosilvalopes commented 1 year ago

I was finally able to reproduce this issue in a friends computer, it seems linkedin's pagination api has a broken count search parameter, might be related to this https://stackoverflow.com/questions/69268130/linkedin-api-returns-empty-shares-posts-and-for-adanalyticsv2-nothing-and-empt/70655719#70655719.

I'll send a fix to this issue later today.

joaosilvalopes commented 1 year ago

This pr should fix this error, merging the pr and closing this issue as original bug reporter is not responding