extractStructuredData method

List<Map<String, String>> extractStructuredData({
  1. required String html,
  2. required Map<String, String> selectors,
  3. Map<String, String?>? attributes,
})

Extracts structured data from HTML content using CSS selectors

html is the HTML content to parse selectors is a map of field names to CSS selectors attributes is a map of field names to attributes to extract (optional)

Implementation

List<Map<String, String>> extractStructuredData({
  required String html,
  required Map<String, String> selectors,
  Map<String, String?>? attributes,
}) {
  return _scraper.extractStructuredData(
    html: html,
    selectors: selectors,
    attributes: attributes,
  );
}