HTMLRewriter is a streaming web content rewriter. This example demonstrates how to use it to scrape content from a target webpage.

Scraping the 'New & Upcoming In Theaters' movies from Rotten Tomatoes and displaying them below.

Index Title Rating
1 undefined 97%
2 Sinners 96%
3 undefined 95%
4 One Battle After Another 85%
5 undefined 87%
6 Nobody Wants This 72%
7 undefined 83%
8 Elio 89%
9 undefined 95%
10 The Pitt 87%
11 undefined 67%
12 Wicked: For Good 93%
13 undefined 98%
14 No Other Choice 92%
15 undefined 97%
16 Sentimental Value 94%
17 undefined 93%
18 The Bear 77%
19 undefined 94%
20 Marty Supreme 83%
21 undefined 99%
22 The Secret Agent 82%
23 undefined 95%
24 Train Dreams 90%
25 undefined 86%
26 Hamnet 93%
27 undefined 90%
28 Arco
29 undefined 99%
30 Hacks 84%
31 undefined 66%
32 Avatar: Fire and Ash 90%
33 undefined 93%
34 Weapons 85%
35 undefined 100%
36 The Narrow Road to the Deep North 74%
37 undefined 83%
38 The Beast in Me 74%