#Finishing requestHandler() request early
1 messages · Page 1 of 1 (latest)
Hello @chilly brook, not sure what you mean exactly.
You may end processing the request from inside of the script, just by returning a void.
router.addHandler('START', async ({ $, crawler, request }) => {
/// ...
if (nothingToScrape) {
return; // sucessfully ends this request and continues in another one
}
// ...
});
Understood, I was doing page.close() and browser.close()
Basically on the page I have a setInterval function that checks for page changes every second, if in 10 seconds the "change" that Im looking for doesn't appear I just want to close the current session and move on to the next request in the queue 🙂