How to parse HTML to DOM in chrome extension
I am building a Chrome Extension, that I will scan many pages of different domains in background and examine whether there are some text patterns in the pages.
I can use regex to search the plain HTML text, but I prefer to parse the HTML text into DOM and then trav开发者_JS百科erse the DOM.
My question is, how can I get the DOM in a Chrome Extension ?
Thanks!
You can get it with jquery:
var html = "<html>...</html>";
var el = $(html).find(".class");
精彩评论