conventional-blackC
Apify & Crawleeโ€ข2y agoโ€ข
5 replies
conventional-black

How can stop crawler and return error when crawler get timeOutError?

I have created a module and intend to perform web scraping by calling a crawler in that module.
If the specified selector cannot be collected during the scraping process,
I want the crawler to stop and return the encountered error.
I would like to check this error using a try/catch statement.

Is there a solution? Or Can I get some test code about it?


example code

const engine = ()=>{
  try{
    const crawler = const crawler = new  PlaywrightCrawler({});
  }catch(err){
 //I want to catch here of crawler's error about     timeout
  }
}
Was this page helpful?