怎样提取网页源代码内的 浏览页面所看到的文字和数字信息!

laorenchunqiu 2006-04-24 01:20:55
假如::
<TABLE class=dearbookbox2 cellSpacing=0 cellPadding=3 width="100%"
border=0>
<TBODY>
<TR>
<TD width=9>
<DIV align=center><IMG height=9
src="/pro.gif" width=9></DIV></TD>
<TD><A class=bookfont title=彻底修炼程序员基本功的书
href="http://www.dearbook.com.cn/2006/writegreatcode/index.htm"
target=_blank>彻底修炼程序员基本功的书</A></TD></TR>
<TR>
<TD width=9>
<DIV align=center><IMG height=9
src="/pro.gif" width=9></DIV></TD>
<TD><A class=bookfont title=Ajax的春天即将来临?
href="http://www.dearbook.com.cn/2006/allajax/index.htm"
target=_blank>Ajax的春天即将来临?</A></TD></TR>
<TR>
<TD width=9>
<DIV align=center><IMG height=9
src="/pro.gif" width=9></DIV></TD>
<TD><A class=bookfont title=《ajax实战》样章全国独家发布
href="http://www.dearbook.com.cn/2006/ajaxpric/index.htm"
target=_blank>《ajax实战》样章全国独家发布</A></TD></TR>
<TR>
<TD width=9>
<DIV align=center><IMG height=9
src="/pro.gif" width=9></DIV></TD>
<TD><A class=bookfont title=《Ajax修炼之道》即将上市
href="http://www.dearbook.com.cn/2006/bvajax/index.htm"
target=_blank>《Ajax修炼之道》即将上市</A></TD></TR>
<TR>
<TD width=9>
<DIV align=center><IMG height=9
src="/pro.gif" width=9></DIV></TD>
<TD><A class=bookfont title="《C++ primer》《代码大全2》等500种图书7折!4月购书风潮!"
href="http://www.dearbook.com.cn/2006/4yue/index.htm"
target=_blank>《C++ primer》《代码大全2》等500种图书7折!4月购书风潮!</A></TD></TR>
<TR>
<TD width=9>
<DIV align=center><IMG height=9
src="/pro.gif" width=9></DIV></TD>
<TD><A class=bookfont title=《代码大全2》7折销售!
href="http://www.dearbook.com.cn/book/90969"
target=_blank>《代码大全2》7折销售!</A></TD></TR>
<TR>
<TD width=9>
<DIV align=center><IMG height=9
src="/pro.gif" width=9></DIV></TD>
<TD><A class=bookfont title=整合移动开发系列图书精品
href="http://www.dearbook.com.cn/2006/mvsubject/index.htm"
target=_blank>整合移动开发系列图书精品</A></TD></TR>
<TR>
<TD width=9>
<DIV align=center><IMG height=9
src="/pro.gif" width=9></DIV></TD>
<TD><A class=bookfont title="3月活动获赠程序员合订本名单 "
href="http://bbs.dearbook.com.cn/2355/ShowPost.aspx"
target=_blank>3月活动获赠程序员合订本名单 </A></TD></TR>
<TR>
<TD width=9>
<DIV align=center><IMG height=9
src="/pro.gif" width=9></DIV></TD>
<TD><A class=bookfont title=购买《代码大全2》获赠D币读者名单
href="http://bbs.dearbook.com.cn/2519/ShowPost.aspx"
target=_blank>购买《代码大全2》获赠D币读者名单</A></TD></TR>
<TR>
<TD width=9>
<DIV align=center><IMG height=9
src="/pro.gif" width=9></DIV></TD>
<TD><A class=bookfont title=图灵四大名著之一《C++primer中文第四版》到货热卖
href="http://www.dearbook.com.cn/book/viewbook.aspx?pno=TS0092394"
target=_blank>图灵四大名著之一《C++primer中文第四版》到货热卖</A></TD></TR>
<TR>
<TD width=9>
<DIV align=center><IMG height=9
src="/pro.gif" width=9></DIV></TD>
<TD><A class=bookfont title=编程卓越之道(第一卷)即将到货
href="http://www.dearbook.com.cn/book/ViewBook.aspx?pno=TS00106003"
target=_blank>编程卓越之道(第一卷)即将到货</A></TD></TR>
<TR>
<TD width=9>
<DIV align=center><IMG height=9
src="/pro.gif" width=9></DIV></TD>
<TD><A class=bookfont title="提勘误建议,得免费赠书——C++ primer中文版(第四版)"
href="http://www.dearbook.com.cn/2006/primerfourth/index.htm"
target=_blank>提勘误建议,得免费赠书——C++ primer中文版(第四版)</A></TD></TR>
<TR>
<TD width=9>
<DIV align=center><IMG height=9
src="/pro.gif" width=9></DIV></TD>
<TD><A class=bookfont title="潘爱民翻译《Effective STL中文版》即将出版"
href="http://www.dearbook.com.cn/book/104893"
target=_blank>潘爱民翻译《Effective STL中文版》即将出版</A></TD></TR>
<TR>
<TD width=9>
<DIV align=center><IMG height=9
src="/pro.gif" width=9></DIV></TD>
<TD><A class=bookfont title=Java2核心技术卷II到货
href="http://www.dearbook.com.cn/book/104973"
target=_blank>Java2核心技术卷II到货</A></TD></TR></TBODY></TABLE>
...全文
376 2 打赏 收藏 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
laorenchunqiu 2006-04-25
  • 打赏
  • 举报
回复
这种方式提取的只是<a ></a>之间的内容!!
Candy38 2006-04-24
  • 打赏
  • 举报
回复
添一段:
<input type="button" onclick="onb()" value="bookname">
<script language="javascript">
function onb(){
for(var i=0;i<document.getElementsByTagName("A").length;i++){
alert(document.getElementsByTagName("A")[i].innerHTML);}}
</script>

21,889

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧