Commit 38e951f
authored
refactor: change Academy code examples to use Crawlee router (#2293)
Fix #2181, address
#2097 (comment) by
@B4nan
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk documentation/exercise refactor that changes sample code
structure to the newer Crawlee `router` API without altering the
scraping behavior.
>
> **Overview**
> Refactors the Crawlee lesson (`12_framework.md`) to construct
`CheerioCrawler` without an inline `requestHandler` and instead register
routing via `crawler.router.addDefaultHandler()` plus labeled
`addHandler()` functions (e.g. `DETAIL`, `IMDB_SEARCH`, `IMDB`).
>
> Updates the associated exercise solutions (`crawlee_f1_drivers.mjs`,
`crawlee_netflix_ratings.mjs`) to match the router-based pattern,
removing `request.label` branching and splitting listing/search/detail
logic into dedicated handlers while keeping the same data extraction and
dataset export steps.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1aa2eb6. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 9003390 commit 38e951f
3 files changed
Lines changed: 221 additions & 228 deletions
File tree
- sources/academy/webscraping/scraping_basics_javascript
- exercises
0 commit comments