WebScraper class

WebScraper Main Class.

Constructors

WebScraper([String? baseUrl])
Creates the web scraper instance.

Properties

baseUrl String?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeElaspsed int?
getter/setter pair

Methods

getAllScripts() List<String>
Returns the list of all data enclosed in script tags of the document.
getElement(String address, List<String> attribs, {String? extraAddress}) List<Map<String, dynamic>>
Returns List of elements found at specified address. Example address: "div.item > a.title" where item and title are class names of div and a tag respectively.
getElementAttribute(String address, String attrib) List<String?>
Returns List of elements' attributes found at specified address respecting the provided attribute requirement.
getElementTitle(String address) List<String>
Returns List of elements titles found at specified address. Example address: "div.item > a.title" where item and title are class names of div and a tag respectively. For ease of access, when using Chrome inspection tool, right click the item you want to copy, then click "Inspect" and at the console, right click the highlighted item, right click and then click "Copy > Copy selector" and provide as String address parameter to this method.
getPageContent() String
Returns webpage's html in string format.
getScriptVariables(List<String> variableNames) Map<String, dynamic>
Returns Map between given variable names and list of their occurence in the script tags
loadFromString(String responseBodyAsString) bool
Loads a webpage that was previously loaded and stored as a String by using getPageContent. This operation is synchronous and returns a true bool once the string has been loaded and is ready to be queried by either getElement, getElementTitle or getElementAttribute.
loadFullURL(String page) Future<bool>
Loads the webpage URL into response object without requiring the two-step process of base + route. Unlike the the two-step process, the URL is NOT validated before being requested.
loadWebPage(String route) Future<bool>
Loads the webpage into response object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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