antonio-nicolau / chaleno Goto Github PK
View Code? Open in Web Editor NEWA Dart package to web scraping data from websites easily and faster using less code lines.
License: MIT License
A Dart package to web scraping data from websites easily and faster using less code lines.
License: MIT License
Chaleno [ UrlException ] : XMLHttpRequest error.
Error: Invalid argument (source): Must be a String or List.: null
@antonio-nicolau ...
I just started trying your webscraper out. It looks like exactly what I want. however, this is what I put in and the error I got ... Any ideas?
class _HomePageState extends State<HomePage> {
String? header, subscribeCount, img;
void scrapData() async {
print('11111');
var parser = await Chaleno().load('https://example.com');
print('2222');
Result result = parser!.getElementById('id');
print(result.text);
And I got these messages
11111
Chaleno [ Exception ]: XMLHttpRequest error.
2222
null
How can I get children of class like
document.getElementsByClassName('class-name')[0].children[2].children[5]....
I'm not found it in Result class
can I execute a custom js dom code ?
var search = "castle";
var searchUrl = 'https://www.google.com/search?q=images%20' + search;
var parser = await Chaleno().load(searchUrl);
print("searchUrl: " + searchUrl);
if(parser == null){
print("parser is null");
return;
}
List<Result>? results = parser.querySelectorAll('img');
if(results == null){
print("results is null");
return;
}
print("count of images " + results.length.toString());
results.forEach((item) => print(item.src));
flutter: searchUrl: https://www.google.com/search?q=images%20castle
flutter: count of images 15
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
flutter: data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
A site address is displayed, but when data is being loaded, ‘Please wait for a moment’ is displayed, and when the data is loaded, the data is displayed.
However, if you use 'await' to scrap, 'Please wait' is displayed.
How do I set the delay?
I need to click elements in website and filling data inside textfiled
Using the examples given in the read me file am getting this error
The method 'getElementById' isn't defined for the type 'Future'.
Try correcting the name to the name of an existing method, or defining a method named 'getElementById'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.