dart-lang / html

Dart port of html5lib. For parsing HTML/HTML5 with Dart. Works in the client and on the server.
https://pub.dev/packages/html
Other
276 stars 59 forks source link

Invalid value #183

Open pkphone opened 2 years ago

pkphone commented 2 years ago

Invalid value: Valid value range is empty: 0 when i parse this website https://www.set.or.th/th/home below is the code:

Future<Response> _initiate(String url) async {
    Response response = await get(Uri.parse(url));
    return response;
}

_initiate('https://www.set.or.th/th/home').then((response) {
      var document = parse(response.body);
      var set = document
          .getElementsByClassName('home-market-update')[0]
          .children[0]
          .children[0]
          .children[1]
          .children[0];

      debugPrint(set.text.trim());
});