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 54%
2 Wolf Man 61%
3 undefined 96%
4 One of Them Days 96%
5 undefined 63%
6 Den of Thieves 2: Pantera 79%
7 undefined 97%
8 Sing Sing 96%
9 undefined 94%
10 I'm Still Here
11 undefined 92%
12 September 5 81%
13 undefined 93%
14 The Brutalist 87%
15 undefined
16 Game Changer 49%
17 undefined 57%
18 Mufasa: The Lion King 89%
19 undefined 87%
20 Sonic the Hedgehog 3 96%
21 undefined 94%
22 Hard Truths 69%
23 undefined 88%
24 Better Man 90%
25 undefined 88%
26 Wicked 95%
27 undefined 79%
28 A Complete Unknown 96%
29 undefined 61%
30 Moana 2 86%
31 undefined 85%
32 Nosferatu 73%
33 undefined 93%
34 The Fire Inside 95%
35 undefined 76%
36 Babygirl 48%
37 undefined 81%
38 The Last Showgirl 72%