怎么抓取网页中的数据,比如这个html中的<li>节点下的值?
- HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><script language="javascript">if (self!=top) window.top.location.replace(self.location);</script><meta http-equiv="Content-Type" content="text/html; charset=gbk" /><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /><title>夫妻笑话-中文幽默王</title><meta name="keywords" content="夫妻笑话" /><meta name="description" content="夫妻笑话-中文幽默王" /><script type="text/javascript" src="http://cbjs.baidu.com/js/s.js"></script><base href="http://www.haha365.com/" /><link href="favicon.ico" rel="shortcut icon" /><link type="text/css" rel="stylesheet" href="templates/2008/skins/default/index.css"/><link type="text/css" rel="stylesheet" href="templates/2008/skins/default/example.css"/></head><body><div id="head"><div class="head_content"><div class="logo"><a href="http://www.haha365.com/"><img src="images/logo.gif" width="197" height="66" alt="中文幽默王,笑话" /></a></div><div class="user_login"><script type="text/javascript">BAIDU_CLB_singleFillSlot("122155");</script></div></div></div><div id="menu_bg"><div class="menu"><li><a href="/">首页</a></li><li><a href="/joke/">笑话大全</a></li><li><a href="/gxtp/">搞笑图片</a></li><li><a href="/bxww/">爆笑网文</a></li><li><a href="/hahags/">哈哈故事</a></li><li><a href="/humor/">综合趣味</a></li><li><a href="/zzkc/">智慧快餐</a></li><li><a href="/mrmy/">名人名言</a></li><li><a href="/hahaqw/">哈哈趣闻</a></li><li><a href="/skl/">段子</a></li><li><a href="http://www.haha365.net/" target="_blank">漫画</a></li><li style="width:2px;"></li></div></div><script type="text/javascript" src="templates/2008/skins/default/wb.js"></script><div id="main"><div class="content"><div id="position">当前位置:<a href="">首页</a><a href="/joke/">笑话大全</a><a href="/fqxh/">夫妻笑话</a></div><div class="blank15"></div><div class="left_box"><div class="item_box"><div class="bg_t"></div><div class="bg_c"><h1>夫妻笑话</h1><hr align="center" width="85%" style="border:1px dashed;color:#D2D6D4;height:1px;margin-bottom:8px;"><ul class="text_doublelist cat_llb"><div class=L16><A href="/fqxh/">夫妻篇</A> <A href="/Adult_joke/">成人篇</A> <A href="/laxh/">恋爱篇</A> <br /><A href="/Family_joke/">家庭篇</A> <A href="/gd_joke/">古代篇</A> <A href="/dn_joke/">电脑篇</A> <br /><A href="/zz_joke/">冷笑话</A> <A href="/mr_joke/">名人篇</A> <A href="/js_joke/">军事篇</A> <br /><A href="/jt_joke/">交通篇</A> <A href="/yr_joke/">愚人篇</A> <A href="/jz_joke/">宗教篇</A> <br /><A href="/mj_joke/">民间篇</A> <A href="/gh_joke/">鬼话篇</A> <A href="/sf_joke/">司法篇</A> <br /><A href="/ty_joke/">体育篇</A> <A href="/jy_joke/">经营篇</A> <A href="/xy_joke/">校园篇</A> <br /><A href="/er_joke/">儿童篇</A> <A href="/yl_joke/">医疗篇</A> <A href="/xd_joke/">现代篇</A> <br /><A href="/gw_joke/">国外篇</A> <a href="/wrxh/">万荣篇</A> <a href="/zc_joke/">职场篇</A><br /></div></ul><br /><ul class="text_doublelist cat_llb"><script type="text/javascript">BAIDU_CLB_singleFillSlot("122262");</script></ul><br /><hr align="center" width="85%" style="border:1px dashed;color:#D2D6D4;height:1px;margin-bottom:8px;"> <ul class="text_doublelist cat_llb"><SCRIPT>sd(5)</SCRIPT></ul><br /> </div><div class="bg_b"></div></div></div><!--left结束--><div class="right w664"><div class="r_t"></div><div class="r_c"><ul class="text_doublelist1"><li> <a href="fqxh/69256.htm" target="_blank" class="url">丈夫竟然提前回家</a></li><li> <a href="fqxh/69255.htm" target="_blank" class="url">你怎么敢失约呢</a></li><li> <a href="fqxh/69254.htm" target="_blank" class="url">带老婆去赌博</a></li><li> <a href="fqxh/69165.htm" target="_blank" class="url">涂了灰指甲,一个传染俩</a></li><li> <a href="fqxh/69164.htm" target="_blank" class="url">拉出来的</a></li><li> <a href="fqxh/69163.htm" target="_blank" class="url">蜂疗</a></li><li> <a href="fqxh/69162.htm" target="_blank" class="url">怕老婆</a></li><li> <a href="fqxh/69078.htm" target="_blank" class="url">不和你走同一路线</a></li><li> <a href="fqxh/69077.htm" target="_blank" class="url">两天前的洗碗水</a></li><li> <a href="fqxh/69076.htm" target="_blank" class="url">夸奖老婆</a></li><li> <a href="fqxh/69044.htm" target="_blank" class="url">重新开始</a></li><li> <a href="fqxh/69043.htm" target="_blank" class="url">西红柿鸡蛋汤真好喝</a></li><li> <a href="fqxh/69042.htm" target="_blank" class="url">找到同类</a></li><li> <a href="fqxh/69041.htm" target="_blank" class="url">男人很少是瞎子</a></li><li> <a href="fqxh/69001.htm" target="_blank" class="url">看到了卖烧饼的</a></li><li> <a href="fqxh/68997.htm" target="_blank" class="url">没有打死老婆</a></li><li> <a href="fqxh/68986.htm" target="_blank" class="url">产房里的安慰</a></li><li> <a href="fqxh/68985.htm" target="_blank" class="url">爱唠叨的老婆</a></li><li> <a href="fqxh/68984.htm" target="_blank" class="url">脚踏两条船</a></li><li> <a href="fqxh/68983.htm" target="_blank" class="url">我们离婚吧</a></li><li> <a href="fqxh/68928.htm" target="_blank" class="url">分配电器</a></li><li> <a href="xy_joke/68794.htm" target="_blank" class="url">丈夫是单身汉</a></li><li> <a href="fqxh/68777.htm" target="_blank" class="url">有情况提前说一声</a></li><li> <a href="fqxh/68740.htm" target="_blank" class="url">吵架</a></li><li> <a href="fqxh/68739.htm" target="_blank" class="url">上点儿货</a></li><li> <a href="fqxh/68738.htm" target="_blank" class="url">到时候还笑不笑得出来</a></li><li> <a href="fqxh/68699.htm" target="_blank" class="url">就叫招弟吧</a></li><li> <a href="fqxh/68545.htm" target="_blank" class="url">树叶落下才甘心吗</a></li><li> <a href="fqxh/68432.htm" target="_blank" class="url">好藏处</a></li><li> <a href="fqxh/68431.htm" target="_blank" class="url">大钻戒</a></li><li> <a href="fqxh/68423.htm" target="_blank" class="url">能不能换个说法</a></li><li> <a href="fqxh/68420.htm" target="_blank" class="url">妻子饿了</a></li><li> <a href="fqxh/68417.htm" target="_blank" class="url">如此美梦</a></li><li> <a href="fqxh/68401.htm" target="_blank" class="url">两根黄瓜</a></li><li> <a href="fqxh/68312.htm" target="_blank" class="url">讨钱</a></li><li> <a href="fqxh/68298.htm" target="_blank" class="url">黑夜</a></li><li> <a href="fqxh/68279.htm" target="_blank" class="url">出名</a></li><li> <a href="fqxh/68272.htm" target="_blank" class="url">送宾</a></li><li> <a href="fqxh/68247.htm" target="_blank" class="url">不用把过程也说出来</a></li><li> <a href="fqxh/68246.htm" target="_blank" class="url">不要拉我的牌友</a></li><li> <a href="fqxh/68149.htm" target="_blank" class="url">攻击(公鸡)</a></li><li> <a href="fqxh/68148.htm" target="_blank" class="url">陪我演场戏</a></li><li> <a href="fqxh/68147.htm" target="_blank" class="url">光明正大包二奶</a></li><li> <a href="fqxh/68146.htm" target="_blank" class="url">喜怒无常</a></li><li> <a href="fqxh/68099.htm" target="_blank" class="url">丈夫的想法</a></li><li> <a href="fqxh/68098.htm" target="_blank" class="url">我不识数</a></li><li> <a href="fqxh/68063.htm" target="_blank" class="url">老公奇想</a></li><li> <a href="fqxh/67949.htm" target="_blank" class="url">婚宴妙语</a></li><li> <a href="fqxh/67948.htm" target="_blank" class="url">要求完美</a></li><li> <a href="fqxh/67947.htm" target="_blank" class="url">妻子的第一个丈夫</a></li><li> <a href="fqxh/67946.htm" target="_blank" class="url">离婚理由</a></li><li> <a href="fqxh/67945.htm" target="_blank" class="url">离后想法</a></li><li> <a href="fqxh/67888.htm" target="_blank" class="url">正文得从第二页开始</a></li><li> <a href="fqxh/67887.htm" target="_blank" class="url">洗衣机坏了</a></li><li> <a href="fqxh/67851.htm" target="_blank" class="url">该关的都关了</a></li><li> <a href="fqxh/67850.htm" target="_blank" class="url">口气也一样</a></li><li> <a href="fqxh/67826.htm" target="_blank" class="url">近在眼前</a></li><li> <a href="fqxh/67825.htm" target="_blank" class="url">先交什么费</a></li><li> <a href="fqxh/67824.htm" target="_blank" class="url">幸亏不是我</a></li><li> <a href="fqxh/67823.htm" target="_blank" class="url">更气人</a></li></ul><div id="pages">总数:<b>1815</b><a href="/fqxh/index_1.htm">首页</a> <a href="/fqxh/index_2.htm">下一页</a> <a href="/fqxh/index_1.htm">上一页</a> <a href="/fqxh/index_31.htm">尾页</a> 页次:<b><font color="red">1</font>/31</b></div> </div><div class="r_b"></div><!--main结束--></div></div><div id="footer"><div class="content"><a onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.haha365.com/');" href="#" > 人生多风雨,幽默常相伴!中文幽默王,快乐每一天!域名最好记,哈哈365 </a><br /><p>CopyRight 2000-2010 中文幽默王 创办于2000年4月6日</p> 10年历史的笑话站 晋ICP备05000110号 </div></div><script type="text/javascript">var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fa9a0b06d8db48871c7d0031ca38769ad' type='text/javascript'%3E%3C/script%3E"));</script></body></html>