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 91%
2 Wicked 99%
3 undefined 74%
4 Gladiator II
5 undefined 92%
6 Conclave 85%
7 undefined 33%
8 Red One 90%
9 undefined 97%
10 Anora 90%
11 undefined 96%
12 A Real Pain 78%
13 undefined 91%
14 Heretic 77%
15 undefined 93%
16 Juror #2 91%
17 undefined 81%
18 Meanwhile on Earth
19 undefined 63%
20 Bonhoeffer: Pastor. Spy. Assassin.
21 undefined 92%
22 Small Things Like These 81%
23 undefined 91%
24 The Best Christmas Pageant Ever 97%
25 undefined 40%
26 Venom: The Last Dance 81%
27 undefined 100%
28 Bread & Roses
29 undefined 35%
30 Here 58%
31 undefined
32 Overlord: The Sacred Kingdom 95%
33 undefined 90%
34 The Piano Lesson
35 undefined
36 Fanmade: ENHYPEN
37 undefined 98%
38 The Wild Robot 98%
39 undefined 81%
40 Blitz 64%