Page API

The Page object represents a fetched web page with a parsed DOM tree. It is the primary interface for extracting data from a single URL.

6 min read Updated July 2026

Constructor

1from crawlingo import Page
2
3# Basic fetch
4page = Page("https://example.com")
5
6# With shared session
7from crawlingo import Session
8session = Session().fetcher_tier("stealthy")
9page = Page("https://example.com", session=session)
ParameterTypeDefaultDescription
urlstrTarget URL to fetch
sessionSessionNoneShared configuration (headers, proxy, rate limit, etc.)

Properties

PropertyTypeDescription
statusintHTTP response status code (e.g. 200, 404)
urlstrFinal URL after all HTTP redirects
html()strRaw HTML page content
markdown()strClean GitHub-flavored markdown conversion of page content

CSS Selectors

css_selectors.py
python
1page = Page("https://example.com")
2
3# Query multiple elements
4elements = page.css("h1")
5elements = page.css("div.price-tag")
6elements = page.css("#main-container")
7
8# Iterate results
9for el in elements:
10 print(el.text()) # Inner text
11 print(el.html()) # Inner HTML
12 print(el.attr("href")) # Attribute value

XPath Selectors

xpath_selectors.py
python
1page = Page("https://example.com")
2
3elements = page.xpath("//h1")
4elements = page.xpath("//div[@class='price']")
5elements = page.xpath("//a/@href")
6
7for el in elements:
8 print(el.text())

Regex Selectors

regex_selectors.py
python
1page = Page("https://example.com")
2
3emails = page.regex(r'[\w.+-]+@[\w-]+\.[\w.]+')
4phones = page.regex(r'\+?1?\d{10,14}')
5
6for match in emails:
7 print(match.text())

Text Anchor Selectors (SIMD-Accelerated)

Locate elements relative to visible text content using SIMD-accelerated string scanning.

text_anchors.py
python
1# Find element by text content
2el = page.find_text("Buy Now")
3
4# Boundary text anchors
5price = page.after_text("Price:")
6name = page.before_text(" - Product Details")

Extraction Types

Apply built-in transformations to clean and normalize extracted values instantly:

Extraction TypeInput ExampleOutput Example
text" Hello World ""Hello World"
price"$1,234.56 USD""1234.56"
datetime"Jan 15, 2024""2024-01-15"
url"/product/1""https://example.com/product/1"