简体   繁体   中英

HTMLParser in Java

I m using HTML parser Library for java here .

I m having a couple of problems , due to less documenation , depite that i suggest HTML parser fast , error prone code than the JSOUP (Jsoup is actually easy to use but easily to be irritated at your code :( )

  1. is how could you extract the meta data ,description on such from the HTML page 2.How you could specifically get a single tag element from the Parsed HTML document

Thankyou !

Get the tag "MyTag", you can also search for tag < meta >

Parser parser = new Parser();
parser.setInputHTML(MyHTML);
parser.setEncoding("UTF-8");
NodeList nl = parser.parse(null); 
NodeList node_list= nl.extractAllNodesThatMatch(new TagNameFilter("MyTag"),true);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM