15 lines
791 B
Plaintext
15 lines
791 B
Plaintext
---
|
|
id: crawl-some-links
|
|
title: Crawl some links on a website
|
|
---
|
|
|
|
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>
|