Docs/API reference

Page

Fetch and inspect an individual page to develop selectors before creating a bulk dataset job.

Download .md
Developers2 min read4 sections
Source reference · Match your SDK version. Availability and known issues
In this guide

Create a page

Python Page(url) loads lazily when content is accessed. Page.create(url) fetches immediately. Node.js uses await Page.create(url, options); its constructor accepts a native page object, not a URL.

from crawlingo import Page

page = Page.create("https://example.com/", timeout=30)
print(page.status, page.title())
print(page.css("h1").text())
python5 lines · copy-ready

Fetch options

Python argumentNode.js options keyType / use
urlurl (first argument)string: HTTP(S) page address.
timeouttimeoutSeconds: int / number.
headersheadersDictionary / record of request headers.
cookiescookiesDictionary / record of cookies.
proxyproxyProxy URL string.
sessionsessionExisting Session instance.
auto_matchautoMatchboolean: enable supported selector recovery.
retriesNot exposedPython constructor argument; do not assume a Node option exists.
Not exposedbrowserProfileNode option string for a transport profile.

Properties and selector methods

PythonNode.jsReturns
page.urlpage.urlstring: page URL.
page.statuspage.statusint / number: HTTP status.
html()page.htmlstring: retained HTML.
title()title()string: document title.
css(selector)css(selector)ElementCollection for a CSS selector.
xpath(query)xpath(query)ElementCollection for a supported XPath query.
find_text(text)findText(text)ElementCollection for matching text.
after_text(text)afterText(text)ElementCollection after matching text.
before_text(text)beforeText(text)ElementCollection before matching text.
regex(pattern)regex(pattern)ElementCollection from a regular-expression query.

From one page to a dataset

Use Page to inspect a representative page and select a record container. Check pages with missing fields too. Page retains HTML and parsed content; do not retain a million Page objects in an application list. Move the extraction rule into DatasetJob fields and feed it a URL file.