Nightmare JS navigation error -3 every 1st run of the day

29 Views Asked by At

I have a Nightmare JS script that is scheduled to run 4 times a day from 8am - 8pm. The script is scraping a website, the 1st part of which is scraping links from the 1st page.

Now the 1st time it loads every day, regardless of whether it is launched by Task Scheduler or if I manually run it, it throws the Navigation Error -3 and then stalls. It only does it on the 1st run of the day and it happens every day. If I then end the task and restart it immediately runs fine and does so for the remainder of the day.

I have 2 questions;

Does anyone have an idea why it may be happening, and how I can prevent it?

If not, any ideas how I can get it to stop and restart itself when this error occurs?

Cheers All

1

There are 1 best solutions below

0
Jonathan Bromell On

Incase anyone else comes across this issue, I fixed it by upping the timeouts to 10000 ms, seems that the issue was the target website taking too long to load.