Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antonio-nicolau/chaleno
A Dart package to web scraping data from websites easily and faster using less code lines.
https://github.com/antonio-nicolau/chaleno
dart flutter-webscrap webscraping webscraping-data
Last synced: about 2 months ago
JSON representation
A Dart package to web scraping data from websites easily and faster using less code lines.
- Host: GitHub
- URL: https://github.com/antonio-nicolau/chaleno
- Owner: antonio-nicolau
- License: mit
- Created: 2021-03-11T10:21:23.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-03T20:20:09.000Z (6 months ago)
- Last Synced: 2024-07-08T17:50:51.073Z (2 months ago)
- Topics: dart, flutter-webscrap, webscraping, webscraping-data
- Language: C++
- Homepage:
- Size: 133 KB
- Stars: 34
- Watchers: 2
- Forks: 10
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Chaleno
A flutter package for webscraping data from websites.This package contains a set of high-level functions that make it easy to webscrap websites. It's multi-platform, supports mobile, desktop, and the web.
# Usage
Scraping data from websites, this package gives you the power to scrape the web in an easy way.
#### Instance Chaleno class
```Dart
var parser = await Chaleno().load('https://example.com');
```
It returns a Parser which we can use to start webscraping.You can load HTML file from localhost.
```Dart
var parser = await Chaleno().load('https://localhost/index');var parser = await Chaleno().load('https://192.168.1.122/index');
```#### Very simple to use
After instantiating Chaleno class, you can easily retrieve any data using few code lines
```Dart
Result result = parser.getElementById('id');
print(result.text);List results = parser.getElementsByClassName('className');
results.map((item) => print(item.text))
```
You can return a single result or a list of results and map them. You can find most popular methods and attributes in table below.### Example
```Dart
final parser = await Chaleno().load('https://example.com');final title = parser?.getElementById('title').text;
final contents = parser.querySelector('.content-card').text;
final image = parser.getElementsByTagName('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 |