BFS-crawl from start_urls (follow same-domain links), extract per page, stream items.
allowed_domainsstring[]
only follow links on these hosts
css_selectorstring
scope the render to this CSS subtree (e.g. a page's content div)
download_delaynumber
seconds to wait between crawl rounds
fetcherstringenum: http, stealthy, dynamic
formatstringenum: markdown, text
render page body to this format
main_content_onlyboolean
strip nav/scripts/hidden before rendering
same_domainboolean
follow only same-host links (default true)
selectorsobject[]
allboolean
return every match as a list
attrstring
extract this attribute instead of text
htmlboolean
extract inner HTML instead of text
stream_namestring
stream to emit items on (default scrapling::crawl)
urlstring
single start URL (alternative to start_urls)
itemsobject[]
a small sample of streamed items
streamobject
read the full item stream via stream::on with this name + group_id
One CSS query over HTML; first-or-all; `attr` pulls an attribute else text.
adaptiveboolean
relocate elements after a site change via saved identities
adaptive_domainstring
page URL/domain that keys saved identities
auto_saveboolean
save matched identities (defaults on when adaptive)
identifierstring
stable key for the saved element
scrapling::describe
functionDescribe the first css/xpath match: attrs, generated selectors, class list, DOM context.
kindstringenum: css, xpath
scrapling::dynamic-fetch
functionPlaywright/Chromium fetch: JS render, waits, XHR capture, CDP; extraction + bulk.
css_selectorstring
scope the render to this CSS subtree (e.g. a page's content div)
formatstringenum: markdown, text
render page body to this format
main_content_onlyboolean
strip nav/scripts/hidden before rendering
selectorsobject[]
allboolean
return every match as a list
attrstring
extract this attribute instead of text
htmlboolean
extract inner HTML instead of text
timeoutnumber
milliseconds (browser fetcher)
waitnumber
extra ms to wait after load
wait_selector_statestringenum: attached, detached, visible, hidden
contentstring
markdown/text render when `format` requested
Fast HTTP fetch, TLS impersonation: get/post/put/delete, inline extraction, bulk `urls`.
css_selectorstring
scope the render to this CSS subtree (e.g. a page's content div)
formatstringenum: markdown, text
render page body to this format
impersonatestring
TLS/UA fingerprint, e.g. 'chrome'
main_content_onlyboolean
strip nav/scripts/hidden before rendering
methodstringenum: get, post, put, delete
proxiesobject
per-scheme proxies, e.g. {"https": "http://..."}
proxy_authstring[]
[user, password]
selectorsobject[]
allboolean
return every match as a list
attrstring
extract this attribute instead of text
htmlboolean
extract inner HTML instead of text
timeoutnumber
seconds (HTTP fetcher)
contentstring
markdown/text render when `format` requested
Find elements by tag/attribute filters (+ optional text regex); BeautifulSoup-style.
attrsobject
attribute filters, e.g. {"class": "card"}
tagstring
tag name or list of tag names
text_regexstring
keep only elements whose text matches this regex
scrapling::find-by-regex
functionFind elements whose visible text matches a regex pattern.
scrapling::find-by-text
functionFind elements whose visible text matches a string (exact or `partial`).
clean_matchboolean
ignore surrounding/collapsing whitespace
partialboolean
match elements that contain the text
scrapling::find-similar
functionStructural auto-match: given one example element, return it plus similar elements.
anchorstring*required
CSS selector to one example element
selectorsobject[]
allboolean
return every match as a list
attrstring
extract this attribute instead of text
htmlboolean
extract inner HTML instead of text
similarity_thresholdnumber
Internal pre_generate hook: appends scrapling usage guidance to the agent system prompt. Bound to harness::hook::pre-generate at worker startup; not called directly.
generateobject
system_promptstring
system prompt assembled so far
mutationsobject*required
system_promptstring
full replacement prompt (base + guidance)
Internal: on engine registry changes, bind the scrapling inject-guidance pre-generate hook once the harness has registered its trigger type. Not called directly.
Run a regex over the visible text of provided HTML; `first` returns the first match, else all.
scrapling::screenshot
functionCapture a page screenshot as image content blocks via a browser fetcher (dynamic or stealthy).
fetcherstringenum: dynamic, stealthy
formatstringenum: png, jpeg
contentobject[]
image blocks (one per tile, width<=1024/height<=1536) + a text caption
datastring
base64 image bytes (image blocks)
typestring*requiredenum: image, text
scrapling::session-close
functionClose a session and free its browser/connection.
session_idstring*required
scrapling::session-fetch
functionFetch a URL on an open session (reuses its cookies/browser); same page/extraction output.
css_selectorstring
scope the render to this CSS subtree (e.g. a page's content div)
formatstringenum: markdown, text
render page body to this format
main_content_onlyboolean
strip nav/scripts/hidden before rendering
methodstringenum: get, post, put, delete
selectorsobject[]
allboolean
return every match as a list
attrstring
extract this attribute instead of text
htmlboolean
extract inner HTML instead of text
session_idstring*required
contentstring
markdown/text render when `format` requested
scrapling::session-list
functionList open sessions with their type and idle time.
typestringenum: http, dynamic, stealthy
filter by type
scrapling::session-open
functionOpen a persistent HTTP/browser session; returns a session_id that reuses cookies + state.
capture_xhrstring
regex; capture matching XHRs (browser sessions)
typestringenum: http, dynamic, stealthy
session engine
Camoufox stealth browser: solves Cloudflare, hardens WebRTC/canvas; extraction + bulk.
css_selectorstring
scope the render to this CSS subtree (e.g. a page's content div)
formatstringenum: markdown, text
render page body to this format
main_content_onlyboolean
strip nav/scripts/hidden before rendering
selectorsobject[]
allboolean
return every match as a list
attrstring
extract this attribute instead of text
htmlboolean
extract inner HTML instead of text
timeoutnumber
milliseconds (browser fetcher)
waitnumber
extra ms to wait after load
wait_selector_statestringenum: attached, detached, visible, hidden
contentstring
markdown/text render when `format` requested
scrapling::to-markdown
functionConvert HTML to compact Markdown (or text/html); optional CSS scope + main-content clean.
css_selectorstring
convert only the subtree matching this CSS selector
formatstringenum: markdown, text, html
main_content_onlyboolean
strip nav/scripts/hidden nodes first
One XPath query over HTML; first-or-all; `attr` pulls an attribute else text.
adaptiveboolean
relocate elements after a site change via saved identities
adaptive_domainstring
page URL/domain that keys saved identities
auto_saveboolean
save matched identities (defaults on when adaptive)
identifierstring
stable key for the saved element