I know there has been many question around this but I did not find any answer to my specific case (which should not be that specific after all).
I am build a html mobile app for multi platform using cordova, angularjs and ionic. My app is getting web pages from a server that I do not own and I need to extract some data from those pages.
I have found many ways but not satisfactory to me.
jQuery : I manage to parse the HTML successfully but unfortunately parsing my html page triggers the loading of the resources such as images which I don't want at all. I just want to extract string from the html page and certainly not load all the images.
create a virtual dom element with innerHTML like this
var el = document.createElement( 'div' );
el.innerHTML = MyHtmlPage;
same issue like JQuery, the resources like image are loaded too.
Using a DomParser like this
var el = new DOMParser().parseFromString(string, 'text/html');
This is not supported by all platform browser.
I wish someone can help me find a decent solution, I may otherwise use regexp but I hate those.