samedi 3 avril 2021

failed to get data from website. using web_scraper plugin flutter

I try to get data from website(twitter site). I have research on the internet and how to get data from website using dart/flutter. So I have found a plugin called web_scraper but i cant understand how do this on by getting inspact of twitter site. so anyone known please kindly help me!

this is code i have tried

i add plugin to puspec.YAML like this

dependencies:
  web_scraper: ^0.1.4

then this is code :

final rawUrl =
                'https://twitter.com/FlutterDev/status/1367166395235012608';
            final webScraper = WebScraper('https://twitter.com');
            final endpoint = rawUrl.replaceAll(r'https://twitter.com', '');
            if (await webScraper.loadWebPage(endpoint)) {
              final titleElements = webScraper.getElement(

                  // I can't think how to find text for here ,

                  []);

              print(titleElements);
            }

this is tweet link : https://twitter.com/FlutterDev/status/1367166395235012608

this is inspect of page enter image description here

Please help me i want tweet title & tweet body only!




Aucun commentaire:

Enregistrer un commentaire