Back to Crawlee

Crawl some links on a website

website/versioned_docs/version-3.13/examples/crawl_some_links.mdx

3.16.0723 B
Original Source

import RunnableCodeBlock from '@site/src/components/RunnableCodeBlock'; import ApiLink from '@site/src/components/ApiLink'; import CrawlSource from '!!raw-loader!roa-loader!./crawl_some_links.ts';

This <ApiLink to="cheerio-crawler/class/CheerioCrawler">CheerioCrawler</ApiLink> example uses the <ApiLink to="core/interface/EnqueueLinksOptions#globs">globs</ApiLink> property in the <ApiLink to="cheerio-crawler/interface/CheerioCrawlingContext#enqueueLinks">enqueueLinks()</ApiLink> method to only add links to the <ApiLink to="core/class/RequestQueue">RequestQueue</ApiLink> queue if they match the specified pattern.

<RunnableCodeBlock className="language-js" type="cheerio"> {CrawlSource} </RunnableCodeBlock>