日期:2014-05-20  浏览次数:20671 次

【HtmlParser】提取网页的meta信息
例如,在html代码里有如下信息:
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META content="aa,bb,cc" name="keywords">
<META content="abcdefg!" name="description">

请问,如何使用HtmlParser从中提取出keywords,description信息?

------解决方案--------------------
直接过滤提取,meta元素有也有专门的Tag类,MetaTag
------解决方案--------------------
不知道api!查看下api啊 3楼的说的有点道理
------解决方案--------------------
获得MetaTag后用getAttribute("content"),getAttribute("name")就可以提取你想要的信息了