Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML parsing in FLUTTER for android / iOS development

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.

like image 983
N I Md Ashafuddula Avatar asked Aug 11 '18 10:08

N I Md Ashafuddula


People also ask

Can I use HTML in flutter?

Flutter is growing with its libraries and community. Earlier, we could use Machine Learning and Flutter together to create powerful applications. Now, we can combine Flutter and HTML too.

Can we use HTML and CSS in flutter?

This package allows you to use simple HTML and inline CSS styles to style your text in flutter.


1 Answers

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.

like image 177
Jaswant Singh Avatar answered Sep 19 '22 22:09

Jaswant Singh