获取HTML源文件 特定的值

luo_373883269 2007-10-23 02:24:36
下面是根据一个URL页面,查看源文件得到的一段HTML格式
我想获取红色 <a > </a >中的超连接文字(比如:Henry Radio;SMT Corp)
还有a中的sid号(如:13685658;28690574)

这段格式我只截取了一部分,还有很多,我要怎么获取这些内容(超连接文字,sid号)

<a href="http://search.stores.ebay.com/search/search.dll?GetResult&sid=13685658&fp=0&query=ni" >Henry Radio </a > </b > </td > <td align="right" width="20%" nowrap > <b >6 matching items </b > </td > <td width="5" > <img height="1" src="http://pics.ebaystatic.com/aw/pics/s.gif" width="5" > </td > </tr > <tr > <td valign="top" colspan="2" >Henry Radio is the manufacturer of high power amplifiers for ham radio, business radio, scientific, and industrial users. We also offer parts and accessories related to amplifiers, RF test equipment,... </td > <td width="5" > <img height="1" src="http://pics.ebaystatic.com/aw/pics/s.gif" width="5" > </td > </tr > </table > </td > </tr > </table > <table width="100%" border="0" cellpadding="0" cellspacing="0" > <tr bgcolor="#656565" > <td > <img src="http://pics.ebaystatic.com/aw/pics/s.gif" width="1" height="1" border="0" > </td > </tr > </table > <table width="100%" border="0" cellpadding="5" cellspacing="0" > <tr bgcolor="#FFFFFF" valign="top" > <td width="100%" > <table width="100%" border="0" cellpadding="1" cellspacing="0" > <tr > <td > <b > <a href="http://search.stores.ebay.com/search/search.dll?GetResult&sid=28690574&fp=0&query=ni" >SMT Corp </a > </b > </td > <td align="right" width="20%" nowrap > <b >6 matching items </b > </td > <td width="5" > <img height="1" src="http://pics.ebaystatic.com/aw/pics/s.gif" width="5" > </td > </tr > <tr > <td valign="top" colspan="2" >A distributor of name brand electronic components, computer peripherals, memory products and all related products </td > <td width="5" > <img height="1" src="http://pics.ebaystatic.com/aw/pics/s.gif" width="5" > </td > </tr > </table > </td > </tr > </table > <table width="100%" border="0" cellpadding="0" cellspacing="0" > <tr bgcolor="#656565" > <td > <img src="http://pics.ebaystatic.com/aw/pics/s.gif" width="1" height="1" border="0" > </td > </tr > </table > <table width="100%" border="0" cellpadding="5" cellspacing="0" > <tr bgcolor="#D0D9FC" valign="top" > <td width="100%" > <table width="100%" border="0" cellpadding="1" cellspacing="0" > <tr > <td > <b >


分不够可以再加
...全文
58 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
luo_373883269 2007-10-24
  • 打赏
  • 举报
回复
<a href="http://search.stores.ebay.com/search/search.dll?GetResult&sid=13685658&fp=0&query=ni" >Henry Radio </a >


<a href="http://search.stores.ebay.com/search/search.dll?GetResult&sid=28690574&fp=0&query=ni" >SMT Corp </a >


这两段
junp2007 2007-10-23
  • 打赏
  • 举报
回复
看不到红色

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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