web_scraper 0.0.5 copy "web_scraper: ^0.0.5" to clipboard
web_scraper: ^0.0.5 copied to clipboard

outdated

A simple web scraper to scrape HTML tags and their attributes to cast them into Lists and Maps for dart and flutter.

Pub

A Simple Web Scraper for Dart & Flutter #

A very basic web scraper implementation to scrap html elements from a web page.

Pull requests certainly welcome.

Installation #

In your pubspec.yaml root add:

dependencies:
  web_scraper: LATEST_VERSION_NUMBER

then,

import 'package:web_scraper/web_scraper.dart';

Implementation #

    final webScraper = WebScraper('https://webscraper.io');
    if(await webScraper.loadWebPage('/test-sites/e-commerce/allinone')){
        List<Map<String, dynamic>> elements = webScraper.getElement('h3.title > a.caption', ['href']);
        print(elements);
    }

Methods #

Method Description Arguments Return Type
loadWebPage Loads the webpage into response object String route Future <bool>
getPageContent Returns webpage's html in string format Void String body
getElement Returns List of elements found at specified address String address, List <String> attributes List <Map<String, dynamic>>
getAllScripts Returns the list of all data enclosed in script tags of the document Void List <String>
getScriptVariables Returns Map between given variable names and list of their occurence in the script tags List <String> variableNames Map <String, dynamic>

Contribute to the package at GitHub. #

  • File bugs, features, etc.
  • Fix bugs and send pull requests
  • Review pull requests
286
likes
0
pub points
91%
popularity

Publisher

verified publishertusharojha.com

A simple web scraper to scrape HTML tags and their attributes to cast them into Lists and Maps for dart and flutter.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, html, http

More

Packages that depend on web_scraper