天天看點

htmlparser解析

Parser parser = new Parser(url);

//*過慮<p>标簽

NodeFilter pfilter = new NodeClassFilter(ParagraphTag.class);

NodeList list = parser.extractAllNodesThatMatch(pfilter);

//*過慮<span>标簽

NodeFilter spanfilter = new NodeClassFilter(Span.class);   

NodeList list = parser.extractAllNodesThatMatch(spanfilter);

繼續閱讀