joaosilvalopes/linkedin-easy-apply-bot

Bug: TimeoutError: Waiting for selector

Closed this issue ยท 9 comments

Hey again. I had my repo sitting on commit eb5bb85 and just now did a git pull.

After reconfiguring everything, I'm getting this error message after puppeteer navigates to the job search:

TimeoutError: Waiting for selector `.jobs-search-results-list li.jobs-search-results__list-item:nth-child(7)` failed: Waiting failed: 5000ms exceeded
    at Timeout.<anonymous> (/Users/helder/Documents/linkedin-easy-apply-bot/node_modules/puppeteer-core/src/common/WaitTask.ts:79:11)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)

I'm running macOS and chrome is installed. npm version is 8.19.1, node version v16.17.0

Let me know how I can help in debugging this issue. Also, thank you for this repo, has helped me immensely.

Hello @helderjbe, welcome back ๐Ÿ™‚, yes you can help me debug right before that line can you put a line with
await wait()(blocks in that line)

And tell me how many jobs are in that page?

Also can you tell me if this pr fixes it?

Yes, it fixes it. Although everything seems like it's working well, this error is being thrown upon applying:

TypeError: Cannot read properties of null (reading 'click')
    at fetchJobLinksUser (/Users/helder/Documents/linkedin-easy-apply-bot/fetch/fetchJobLinksUser.ts:127:26)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /Users/helder/Documents/linkedin-easy-apply-bot/scripts/apply.ts:69:45

I don't know if this is related to this issue though

Yes this error is job posting specific it won't affect the whole listing, though it shouldn't be happening, I added a new commit to this branch that should fix it, can you test this for me please @helderjbe?

It seems that it cleared that, however, I'm getting another error at

Error: Error: failed to find element matching selector ".jobs-search-results-list li.jobs-search-results__list-item:nth-child(10) a.job-card-list__title"
    at CDPElementHandle.$eval (/Users/helder/Documents/linkedin-easy-apply-bot/node_modules/puppeteer-core/src/common/ElementHandle.ts:141:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async fetchJobLinksUser (/Users/helder/Documents/linkedin-easy-apply-bot/fetch/fetchJobLinksUser.ts:121:31)
    at async /Users/helder/Documents/linkedin-easy-apply-bot/scripts/apply.ts:69:45

This shows up only sometimes though.

I'm just sharing this for the sake of completion. It seems that it's working well already.

No problem @helderjbe, Thanks for reporting! Bug reports are always welcome!

I added yet another commit that should fix that one (that bug was caused by the previous bug fix ;-;)

Can you check for me? (since i haven't been able to reproduce any of this on my pc)

Yep, looks like it's working nicely now! Thanks for the help!

Alright I'm gonna be merging this pr and closing this issue now, feel free to open more ๐Ÿ™‚