Data class

Container for scraped data that includes both the source URL and extracted content.

This class serves as a wrapper for data extracted during web scraping operations. It maintains the relationship between the source URL and the extracted data, which is essential for tracking data provenance and handling relative URLs.

The obj field can contain any type of data:

  • HTML elements (Element, List<Element>)
  • Text content (String)
  • Structured data (Map, List)
  • Parsed JSON data
  • Any other extracted content

Constructors

Data.new(Uri url, Object obj)
Creates a new Data instance.
Data.fromJson(String json)
Creates a Data instance from a JSON string.
factory
Data.fromMap(Map<String, dynamic> map)
Creates a Data instance from a Map.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
obj Object
The extracted data content.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
url Uri
The source URL where the data was extracted from.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() String
Converts the Data instance to a JSON string.
toMap() Map<String, dynamic>
Converts the Data instance to a Map.
toString() String
A string representation of this object.
inherited

Operators

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