Basically I have a basic Puppeteer code which works great.
But the website I'm using sometimes either loads slower, or doesn't select a selector.
In result, this throws a timeout error:
(node:17340) UnhandledPromiseRejectionWarning: TimeoutError: waiting for selector `.item-price` failed: timeout 30000ms exceeded
And I need to close the CMD and start the task again. Which is quite frustrating when you are trying of running 20-30 of those.
My question is, is there a command, that whenever the TimeoutError occurs, it would restart the process again?
I'm not a code, but I guess I would need to enter the line, from which it should start again?
Any help would be appreciated.
P.S. when the error occurs, it doesn't close the headless browser, so I guess it should be possible?