I had tried Jquery, Parse5, JsDom, and found that they can't work in nativescript. Jquery is Dom-dependent, and Parse5 and JsDom depend on Node.js which is not supported by nativescript now. What I want is only a html-parser, is it possible to import jquery into nativescript using as a hmtl-parser? If it's possible how can I make it.If not, Is there a handy html-parser can be used in Nativescript(With Angular2 + TypeScripyt)。
Details about my application. I am developping a mobile app for moodle use nativescript。My app communicates with moodle by moodle's rest api, and some content of it is html string. So I need a html-parser to get the things in that html-string.
For example, I send a "mod_quiz_get_attempt_data" request to moodle. And I will fetch a json response as below:
{"questions": [ { "slot": 1, "type": "multichoice", "page": 0, "html": "Html string here.Can be very complex.I can't post html-string, stackoverflow ignore them", } ] }
Some data I need is in the "html" part which is html-string.Because moodle is a third party,So I prefer to handle this in my app。
@Marek Maszay, @Emil Oberg
@Emil Oberg, I have given cheerio a try.It doesn't work.Because cheerio depends on htmlparser2 which is also depend on Nodejs.