common_browser.reading
Shared observation pipeline and the corresponding scoped Page methods.
Classes
PageReading
Full-signature observation conveniences on the public Page handle.
extract
async def extract(model: type[T], *, config: ExtractConfig | None = None, rows: Target | None = None, fields: Mapping[str, FieldRead] | None = None, limit: int | None = None, max_field_chars: int | None = None, options: OperationConfig | None = None) -> BrowserResult[Extraction[T]]Validate each observed raw row into the caller’s Pydantic-compatible type.
extract_with
async def extract_with(decoder: Callable[[Mapping[str, object]], T], *, config: ExtractConfig | None = None, rows: Target | None = None, fields: Mapping[str, FieldRead] | None = None, limit: int | None = None, max_field_chars: int | None = None, options: OperationConfig | None = None) -> BrowserResult[Extraction[T]]Convert each captured row with one synchronous caller-owned decoder.
is_enabled
async def is_enabled(target: Target | ElementRef, *, options: OperationConfig | None = None) -> BrowserResult[bool]Observe browser enabled semantics; false is a successful observation.
read
async def read(config: ReadConfig | None = None, *, mode: Literal['text', 'html'] | None = None, scope: Target | ElementRef | None = None, max_chars: int | None = None, options: OperationConfig | None = None) -> BrowserResult[PageContent]Read one scope; text is rendered text and HTML includes the outer node.
scan
async def scan(config: ScanConfig | None = None, *, scope: Target | ElementRef | None = None, limit: int | None = None, max_nodes: int | None = None, max_text_chars: int | None = None, include_hidden: bool | None = None, include_frames: bool | None = None, max_frames: int | None = None, include_accessibility: bool | None = None, options: OperationConfig | None = None) -> BrowserResult[PageSnapshot]Observe bounded DOM facts, with explicit iframe and accessibility capture.
ReadingAspect
One shared read/scan/extract pipeline, inherited by BaseBrowser.
Types and values
T
T = TypeVar('T')