HTML parsing in FLUTTER for android / iOS development

N I Md Ashafuddula picture N I Md Ashafuddula · Aug 11, 2018 · Viewed 8.6k times · Source

We know there is a Jsoup library for android developers to parse html text, code etc. As I am new in flutter mobile app development I want to know if there is any library like Jsoup to parse html text,code from a web site in flutter.

Answer

Jaswant Singh picture Jaswant Singh · Aug 11, 2018

You can parse a HTML string this way

import ‘package:html/parser.dart’;
//here goes the function 

String _parseHtmlString(String htmlString) {

var document = parse(htmlString);

String parsedString = parse(document.body.text).documentElement.text;

return parsedString;
}

Please let me know this doesn’t solve your problem.