Puppeeter – Catch no connection Error and do some action

I would like to use a puppeeter to create a bot that will check if there is an active internet connection (sometimes it breaks it and I have to reset the router), so if the connection failed, the bot would automatically log into my router panel and reset it (this is not is a problem, but I do not know how to catch the lack of internet with a puppeter)

Thank you very much for any help and idea!


guys, i know how to use puppetter, and implement this thing, BUT i dont know what should i put into condition, to check connection, for example i have

some loop lets say

 for (let i = 0; i < 20000; i++) {
if(NOCONNECTION){then do something}
 await delay(randomInteger(18000, 48000));

I just dont know, how to check if i have connection ;/ – so the problem is NOCONNECTION ;/

66 thoughts on “Puppeeter – Catch no connection Error and do some action”

  1. Hey, if you are looking for more resources, check out my website xrank.cyou as I cover a lot of same topics from your niche. By the way, you have impressive design and layout, plus interesting content about SEO, you deserve a high five!


Leave a Comment