Skip to content

Commit ec059b0

Browse files
committed
fix: improvements to the framework lesson
1 parent ce69c62 commit ec059b0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sources/academy/webscraping/scraping_basics_javascript2/12_framework.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ await crawler.run(['https://warehouse-theme-metal.myshopify.com/collections/sale
5353
In the code, we do the following:
5454

5555
1. Import the necessary module.
56-
2. Create a crawler object, which manages the scraping process. In this case, it's a `CheerioCrawler`.
57-
3. Define an asynchronous `requestHandler` function. It receives a context object with Cheerio `$` and a logger.
56+
2. Create a crawler object, which manages the scraping process. In this case, it's a `CheerioCrawler`, which requests HTML from websites and parses it with Cheerio. Other crawlers, such as `PlaywrightCrawler`, would be suitable if we wanted to scrape by automating a real browser.
57+
3. Define an asynchronous `requestHandler` function. It receives a context object with Cheerio's `$` instance and a logger.
5858
4. Extract the page title and log it.
5959
5. Run the crawler on a product listing URL and await its completion.
6060

@@ -213,7 +213,8 @@ const crawler = new CheerioCrawler({
213213
url: request.url,
214214
title: $(".product-meta__title").text().trim(),
215215
vendor: $('.product-meta__vendor').text().trim(),
216-
...priceRange, // highlight-next-line
216+
...priceRange,
217+
// highlight-next-line
217218
variantName: null,
218219
};
219220

0 commit comments

Comments
 (0)