During parsing, storing some data about the parsing itself can be useful for debugging, monitoring, and reporting. The Stats page input allows storing such data.

For example, you can use stats to track which parsing code is actually used, so that you can remove code once it is no longer necessary due to upstream changes:

from attrs import define
from web_poet import field, Stats, WebPage

class MyPage(WebPage):
    stats: Stats

    def title(self):
        if title := self.css("h1::text").get():
        elif title := self.css("h2::text").get():
        return title