chaleno
a flutter package to webscraping data from websites
this package contains a set of high-level functions that make it easy to webscrap websites. it’s multi-platform, and supports mobile, desktop, and the web.
a dart package to web scraping data from websites easily and faster using less code lines.
usage
webscraping any data from website, this package give you this power from the easely way
instance chaleno classe
var parser = await chaleno().load('https://example.com');
it return a parser witch one we will use to get any data
you can load html file from localhost
var parser = await chaleno().load('https://localhost/index');
var parser = await chaleno().load('https://192.168.1.122/index');
very simple to use
after intance chaleno class, you can easily take any data using few code lines
result result = parser.getelementbyid('id');
print(result.text);
list<result> results = parser.getelementsbyclassname('classname');
results.map((item) => print(item.text))
you can return a single result or a list of results and go map them. you can find most popular methods and attributs in table bellow
example
var parser = await chaleno().load('https://filipedeschamps.com.br/newsletter');
header = parser.getelementsbyclassname('title')[0].text;
subscribecount = parser.queryselector('.subscribers-count-note').text;
image = parser.queryselector('.jsx-1373700303 img').src;
importants methods and propriets
methods | mean |
---|---|
title | return the page title |
getelementbyid | return a single element searching for id on the page |
getelementsbyclassname | return a list of elements according class passed as parameter |
getelementsbytagname | return a list of elements according tag passed as parameter |
queryselector | return single element passing a list of selector |
queryselectorall | return a list of elements passing a list of selector |
text | return text atribute from a tag returned |
src | return src atribute from a tag returned |
href | return href atribute from a tag returned |
Comments are closed.