HeadlessBrowserService class
Service for headless browser operations
Constructors
- HeadlessBrowserService.new({HeadlessBrowser? browser, ProxyManager? proxyManager, DynamicUserAgentManager? userAgentManager, SiteReputationTracker? reputationTracker, ScrapingLogger? logger, HeadlessBrowserConfig? config, bool useProxies = true, bool rotateProxies = true, int maxRetries = 3})
- Creates a new HeadlessBrowserService instance
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearCache(
) → Future< void> - Clears the browser cache
-
clearCookies(
) → Future< void> - Clears all cookies
-
dispose(
) → Future< void> - Disposes the service
-
executeScript(
String script) → Future - Executes JavaScript on a page
-
getCookies(
String url) → Future< List< Map< >String, String> > - Gets all cookies for the current page
-
initialize(
) → Future< void> - Initializes the service
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
scrapeUrl(
String url, {Map< String, String> ? headers, Map<String, String> ? selectors, Map<String, String> ? attributes, bool takeScreenshot = false, int? timeoutMillis, bool useProxy = true, Proxy? specificProxy}) → Future<HeadlessBrowserResult> - Scrapes a URL using the headless browser
-
setCookies(
String url, List< Map< cookies) → Future<String, String> >void> - Sets cookies for the current page
-
toString(
) → String -
A string representation of this object.
inherited
-
waitForElement(
String selector, {int timeoutMillis = 10000}) → Future< bool> - Waits for an element to be present in the DOM
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited