joaosilvalopes / linkedin-easy-apply-bot

MIT License
237 stars 87 forks source link

Bug: TimeoutError: Waiting for selector #50

Closed helderjbe closed 1 year ago

helderjbe commented 1 year ago

Hey again. I had my repo sitting on commit https://github.com/joaosilvalopes/linkedin-easy-apply-bot/commit/eb5bb859b2057de01d42f114c8b131135b2b7fad 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.

joaosilvalopes commented 1 year ago

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?

joaosilvalopes commented 1 year ago

Also can you tell me if this pr fixes it?

helderjbe commented 1 year ago

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

joaosilvalopes commented 1 year ago

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?

helderjbe commented 1 year ago

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.

joaosilvalopes commented 1 year ago

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 ;-;)

joaosilvalopes commented 1 year ago

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

helderjbe commented 1 year ago

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

joaosilvalopes commented 1 year ago

Alright I'm gonna be merging this pr and closing this issue now, feel free to open more 🙂