Home > OS >  How I web-scrape the data a website that I need perform some action in website before the data I nee
How I web-scrape the data a website that I need perform some action in website before the data I nee

Time:02-06

The website that I would like to scrape

Before scraping the data I need first I must choose departure, arrival and date then I must clicked the green buton then I can reach the data I would like to scrape.

How I can perform these actions in website via Flutter. Then I will use these datas in the Flutter app.

I tried to scrape via import http.dart and parser.dart libraries but I couldn't. I am beginner in coding and Flutter.

CodePudding user response:

Hey found a article which will help you do this.

Follow :

https://morioh.com/p/b7b4aa4d696e

Kudos to Morioh for the detailed step by step article.

Concern : this might be outdated package as there is no update since past one year.

CodePudding user response:

You maybe need the dart:html in all app scope , but this file are limited on the web (or You need to do something different on the web than on an Android device!).

you can create 3 file and to handle this mode.

file web.dart :

import 'dart:html' as html;

void webScrap() {
  // blablabla webScrap in web
}


String cookie = "";

file native.dart :

void webScrap() {
  // blablabla webScrap in native
}

String cookie = "";

file switch_native_web.dart :

import 'native.dart' if (dart.library.html) 'web.dart' as switch_value;

class SwitchNativeWeb {

  static String cookie = switch_value.cookie;

  static void webScrap() {
    switch_value.webScrap();
  }
}

But i suggest to you , see this example for web scraping in flutter .

Gist full Snippets: Gist.Github.com

Repository : Github.com

  • Related