nehalistN
Apify & Crawlee2mo ago
3 replies
nehalist

Is there a type for "any crawler"?

🎭PlaywrightCrawler
I have a bunch of different crawler definitions (for different sites) that might use different crawlee crawlers. Site X might use a
PlaywrightCrawler
while site Y uses
CheerioCrawler
. I wrap this logic in a definition like

class SiteXCrawlerDefinition {
  getCrawler() { return new PlaywrightCrawler() }
}


since I do want to add an interface to the crawler definition classes I'd need a return type for
getCrawler
.
BasicCrawler
doesn't work - is there another type for "just any crawlee crawler"?
Was this page helpful?