在vb中实现提取html源代码中的td标记值问题,急

来源:百度知道 编辑:UC知道 时间:2024/05/31 02:21:35
请问我如何在vb中提取html源代码中的td标记值呢?有的<td>后面还有<colspan=5><fontsize=4>这些标记,又怎么样去除呢?是否用到什么document模型呢?我很着急,谢谢哪位高手能够给我些指点!方便的话能加我个qq或msn么?qq:173635235, msn:bisal1130@yahoo.com.cn,真的谢谢了!

以下代码是提取两个<dt>标记之间的字符(后面一个其实是</dt>)
'strfrom是源代码
'strto()'是输出文字
'strtocount是输出文字的数量
do until instr(1,strfrom,"<td>")=0
strfrom=mid(strfrom,instr(1,strfrom,"<td>")+4)
if instr(1,strfrom,"</td>")>0 then
strtocount=strtocount+1
redim preserve strto(1 to strtocount) as string
strto(strtocount)=mid(strfrom,1,instr(1,strfrom,"</td>")>-1)
strfrom=mid(strfrom,instr(1,strfrom,"</td>")+5)
end if
loop

由于没有vb系统,就没有测试,原理就这样