Skip to content

Options Reference

Browser settings live in Pam\Crawl\Render\RenderOptions, part of the core package. The crawler’s builder methods set the common ones for you; renderOptions() reaches the rest:

use Pam\Crawl\Crawl;
use Pam\Crawl\Render\RenderOptions;
Crawl::url($url)->renderOptions(fn (RenderOptions $o) => $o->with([
'waitForImages' => true,
'delayBeforeReturn' => 0.5,
'extra' => $o->extra + ['tabs' => 2],
]));
Crawl4AI PAM Crawl Notes
wait_until, page_timeout ->waitUntil('networkidle'), pageTimeout domcontentloaded (default), load, networkidle; page timeout default 60 s
wait_for (css: / js: / auto) ->waitFor('css:.item', 10) waitFor, waitForTimeout (default 30 s)
js_code, js_code_before_wait ->js('return document.title'), jsBeforeWait Results in $page->jsResults
delay_before_return_html delayBeforeReturn Default 0.1 s
wait_for_images waitForImages
scan_full_page, scroll_delay, max_scroll_steps ->scrollFullPage(0.2, 20) scanFullPage, scrollDelay, maxScrollSteps
virtual_scroll_config ->virtualScroll('#feed', 30) Recycled DOM rows merged uniquely
process_iframes processIframes Same-origin and cross-origin iframes inlined
flatten_shadow_dom flattenShadowDom Closed roots included
remove_overlay_elements, remove_consent_popups removeOverlays, removeConsentPopups Crawl4AI’s own scripts
simulate_user, override_navigator, magic ->magic(), or stealth, simulateUser webdriver flag, plugins, languages, WebGL vendor, chrome object
init_scripts initScripts Run before any page script
Text mode, resource blocking ->blockResources('image', 'font') blockResources
Viewport, device scale, mobile ->viewport(390, 844, 3, mobile: true) viewport (default 1280 x 800), deviceScaleFactor, mobile
locale, timezone_id, geolocation locale, timezone, geolocation Geolocation permission granted per origin
user_agent, headers, cookies ->userAgent(), ->headers(), ->cookies() The same identity as HTTP crawling
proxy_config ->proxy('http://user:pass@host:port') Proxy authentication answered over CDP
user_data_dir, persistent context userDataDir Logged-in profiles
session_id, kill_session ->tab('login'), $renderer->killSession('login') sessionId; the tab survives across calls
screenshot, screenshot_height_threshold ->screenshot() screenshot, fullPageScreenshot; tall pages captured in chunks and stitched
pdf ->capturePdf() $page->pdfBytes
capture_mhtml ->captureMhtml() $page->mhtml
capture_network_requests ->captureNetwork() Requests, responses, failures, timing
capture_console_messages ->captureConsole() Console messages and page errors
accept_downloads, downloads_path ->downloads('/dir') $page->response->artifacts['downloads']
browser_type ->engine('chrome') engine: auto, chrome, lightpanda or a CDP URL
headless headless Default true
Status, headers, redirects $page->status, $page->response->headers Main document only, final URL

RenderOptions::$extra carries settings beyond Crawl4AI’s:

Key Purpose
tabs Parallel tabs (default min(8, concurrency))
recycleAfter Pages per tab before it is reopened
settle, settleTimeout, settleQuiet The settle step that waits for a quiet network and DOM; settle => false disables it
jsOnly Run session steps in a tab() without navigating
screenshotWait, screenshotHeightThreshold Screenshot timing and chunking
downloadTimeout Seconds to wait for downloads
maxCaptureEntries Cap on network and console entries
chromePath, lightpandaPath, chromeArgs, lightpandaArgs Binaries and switches
gpu false for software rendering
lightpandaCapture, fallbackToChrome Engine routing
launchTimeout Browser start-up timeout
networkBodies, networkBodyMaxBytes, networkBodyTotalBytes, networkBinaryBodies Network response bodies
cdpCaFile CA bundle for TLS CDP endpoints

Rendered pages expose the common results as Page properties (screenshot, pdfBytes, mhtml, network, console, jsResults, rendered). Everything is also in $page->response->artifacts:

Key Content
renderer chrome, lightpanda or remote: the engine that rendered the page
js, jsBeforeWait Script results
screenshot, screenshots PNG bytes; chunks when the gd extension is missing
pdf, mhtml Captures
network, console Captured entries
redirects, downloads Navigation redirects, downloaded files
virtualScroll, iframes Virtual scroll and iframe reports
sessionId, warnings, timing Session tab, non-fatal problems, timings

Pam\Crawl\Browser\BrowserRenderer implements the core’s Pam\Crawl\Render\Renderer interface.

Method Description
BrowserRenderer::chrome(?BrowserConfig $config = null) Chrome only
BrowserRenderer::lightpanda(?BrowserConfig $config = null) Lightpanda, with Chrome fallback
BrowserRenderer::connect(string $endpoint, ?BrowserConfig $config = null) A remote CDP browser
BrowserRenderer::fromOptions(RenderOptions $options) What the crawler uses by default
render(array $requests, RenderOptions $options): Generator Render requests, yielding responses in completion order
killSession(string $sessionId), sessions(): list<string> Session tabs
engines(): list<string> Engines currently running
close() Stop exactly the browsers this renderer started; idempotent

BrowserConfig properties are listed on the Engines page.

All exceptions extend Pam\Crawl\Browser\Exception\BrowserRenderException, a RuntimeException:

Exception Thrown when
EngineUnavailable The requested engine is not installed or failed to start
JavaScriptError A script evaluated in the page threw
RenderTimeout A render exceeded its timeout
Unsupported The engine cannot do what the request needs; the renderer falls back to Chrome

This product includes software developed by UncleCode (https://x.com/unclecode) as part of the Crawl4AI project (https://github.com/unclecode/crawl4ai).