如何使用htmlparser获得指定标签里的内容? 20
2个回答
展开全部
Parser parser = new Parser(currentURL);
AndFilter filter =
new AndFilter(
new TagNameFilter("div"),
new HasAttributeFilter("id","userName")
);
NodeList nodes = parser.parse(filter);
AndFilter filter =
new AndFilter(
new TagNameFilter("div"),
new HasAttributeFilter("id","userName")
);
NodeList nodes = parser.parse(filter);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Parser parser3 = Parser.createParser(content, charset);
AndFilter filter3 =
new AndFilter(new TagNameFilter("span"),new HasAttributeFilter("id","J_SingleEndTimeLabel"));
NodeList nodeList3 = parser3.parse(filter3);
http://gundumw100.javaeye.com/blog/704630
AndFilter filter3 =
new AndFilter(new TagNameFilter("span"),new HasAttributeFilter("id","J_SingleEndTimeLabel"));
NodeList nodeList3 = parser3.parse(filter3);
http://gundumw100.javaeye.com/blog/704630
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询