WebScraper class

High-level web scraper that combines HTML fetching and data parsing.

This class provides a simplified interface for web scraping by combining the Scraper (for fetching HTML) and WebParser (for extracting data) into a single, easy-to-use API.

Example usage:

final scraper = WebScraper();
final configMap = {
  'example.com': [ScraperConfig(...)]
};

final data = await scraper.scrape(
  url: Uri.parse('https://example.com'),
  scraperConfigMap: configMap,
);

Constructors

WebScraper.new()

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

canScrape({required Uri url, required ScraperConfigMap scraperConfigMap}) bool
Checks if the given URL can be scraped with the provided configuration.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scrape({required Uri url, ScraperConfig? scraperConfig, ScraperConfigMap? scraperConfigMap, bool debug = false, String? html, Map<String, String>? overrideCookies, Map<String, String>? overrideHeaders, String? overrideUserAgent, ProxyAPIConfig? overrideProxyAPIConfig}) Future<Map<String, Object>>
Performs complete web scraping including HTML fetching and data extraction.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited