Skip to main content

Module webdriver

Module webdriver 

Source
Available on crate feature webdriver only.
Expand description

WebDriver utils

Structs§

WebDriverController
WebDriver controller with RAII cleanup (mirrors BrowserController).

Constants§

CLEANUP_CDP_MARKERSwebdriver_stealth
Stealth scripts from spider_fingerprint - cleans up automation markers. Clean up ChromeDriver markers (cdc_, $cdc_) that anti-bot systems detect. These properties are injected by ChromeDriver for automation control. Non-intrusive: only removes properties that match known automation patterns. Safe: wrapped in try-catch, checks property existence before removal.
HIDE_SELENIUM_MARKERSwebdriver_stealth
Stealth scripts from spider_fingerprint - cleans up automation markers. Hide selenium-specific markers from the window and document objects. Non-intrusive: only patches properties that actually exist on the object. Safe: all operations wrapped in try-catch, won’t throw or break page.
HIDE_WEBDRIVERwebdriver_stealth
Stealth scripts from spider_fingerprint - cleans up automation markers. Hide the webdriver from being enabled. You should not need this if you use the cli args to launch chrome - disabled-features=AutomationEnabled

Functions§

attempt_navigation
Attempt to navigate to a URL.
close_driver
Close the WebDriver session (consumes the driver).
execute_script
Execute JavaScript on the page and return the result as a JSON value.
get_current_url
Get the current URL.
get_page_content
Get the page content (HTML source).
get_page_title
Get the page title.
get_random_webdriver_viewportreal_browser
Get a random viewport for stealth purposes.
launch_driver
Launch a WebDriver session with the provided configuration.
launch_driver_base
Launch a WebDriver session with the base configuration.
run_automation
Run a single WebAutomation action on the WebDriver.
run_automation_scripts
Run a list of WebAutomation actions on the WebDriver.
run_execution_scripts
Run execution scripts (JavaScript) for a specific URL.
run_url_automation_scripts
Run automation scripts for a specific URL.
setup_driver_eventswebdriver_stealth
Setup WebDriver events and stealth mode. Injects spider_fingerprint stealth scripts to:
spoof_device_memorywebdriver_stealth
Stealth scripts from spider_fingerprint - cleans up automation markers. Spoof navigator.deviceMemory - commonly fingerprinted property. Returns a realistic value based on the platform (4-8 GB for desktop, 2-4 for mobile). Non-intrusive: only patches if property exists or is supported.
take_screenshotwebdriver_screenshot
Take a screenshot of the page.
wait_for_element
Wait for an element to be present.

Type Aliases§

WebDriverControl
WebDriver control tuple type alias (mirrors BrowserControl).