主题:vb 提取文本中 指定的URL
文本内容如下:
<LI><A title=查看3 style="BACKGROUND-IMAGE: url(http://hd44.xiaonei.com/photos/hd44/20080704/22/45/tiny_6046c169.jpg)" href="http://xiaonei.com/getuser.do?portal=homeFootprint&id=223997507"></A><SPAN class="olname clearfix"><IMG title="3 在线" src="http://xnimg.cn/imgpro/icons/online.gif"><A href="http://xiaonei.com/getuser.do?portal=homeFootprint&id=223997507">3</A></SPAN><SPAN class=small>昨天</SPAN> </LI>
<LI><A title=查看2 style="BACKGROUND-IMAGE: url(http://hd36.xiaonei.com/photos/hd36/20080923/19/04/tiny_zOWC_6918e200150.jpg)" href="http://xiaonei.com/getuser.do?portal=homeFootprint&id=239335810"></A><SPAN class="olname clearfix"><IMG title="2 在线" src="http://xnimg.cn/imgpro/icons/online.gif"><A href="http://xiaonei.com/getuser.do?portal=homeFootprint&id=239335810">2</A></SPAN><SPAN class=small>昨天</SPAN> </LI>
<LI><A title=查看1 style="BACKGROUND-IMAGE: url(http://hd52.xiaonei.com/photos/hd52/20080609/16/55/tiny_4959d169.jpg)" href="http://xiaonei.com/getuser.do?portal=homeFootprint&id=221156796"></A><SPAN class="olname clearfix"><IMG title="1 在线" src="http://xnimg.cn/imgpro/icons/online.gif"><A href="http://xiaonei.com/getuser.do?portal=homeFootprint&id=221156796">1</A></SPAN><SPAN class=small>10月15日</SPAN> </LI>
我想从 以上文本中获取 如:http://xiaonei.com/getuser.do? 样式的链接并输出 怎么做?
我的代码如下:
Open 文本路径 For Input As #1
Do While Not EOF(1)
Line Input #1, a
If Left$(a, 30) = "http://xiaonei.com/getuser.do?" Then
If wenben = "" Then
wenben = a
Else
wenben = wenben + vbNewLine + a
End If
End If
可是为什么得不到呢?
<LI><A title=查看3 style="BACKGROUND-IMAGE: url(http://hd44.xiaonei.com/photos/hd44/20080704/22/45/tiny_6046c169.jpg)" href="http://xiaonei.com/getuser.do?portal=homeFootprint&id=223997507"></A><SPAN class="olname clearfix"><IMG title="3 在线" src="http://xnimg.cn/imgpro/icons/online.gif"><A href="http://xiaonei.com/getuser.do?portal=homeFootprint&id=223997507">3</A></SPAN><SPAN class=small>昨天</SPAN> </LI>
<LI><A title=查看2 style="BACKGROUND-IMAGE: url(http://hd36.xiaonei.com/photos/hd36/20080923/19/04/tiny_zOWC_6918e200150.jpg)" href="http://xiaonei.com/getuser.do?portal=homeFootprint&id=239335810"></A><SPAN class="olname clearfix"><IMG title="2 在线" src="http://xnimg.cn/imgpro/icons/online.gif"><A href="http://xiaonei.com/getuser.do?portal=homeFootprint&id=239335810">2</A></SPAN><SPAN class=small>昨天</SPAN> </LI>
<LI><A title=查看1 style="BACKGROUND-IMAGE: url(http://hd52.xiaonei.com/photos/hd52/20080609/16/55/tiny_4959d169.jpg)" href="http://xiaonei.com/getuser.do?portal=homeFootprint&id=221156796"></A><SPAN class="olname clearfix"><IMG title="1 在线" src="http://xnimg.cn/imgpro/icons/online.gif"><A href="http://xiaonei.com/getuser.do?portal=homeFootprint&id=221156796">1</A></SPAN><SPAN class=small>10月15日</SPAN> </LI>
我想从 以上文本中获取 如:http://xiaonei.com/getuser.do? 样式的链接并输出 怎么做?
我的代码如下:
Open 文本路径 For Input As #1
Do While Not EOF(1)
Line Input #1, a
If Left$(a, 30) = "http://xiaonei.com/getuser.do?" Then
If wenben = "" Then
wenben = a
Else
wenben = wenben + vbNewLine + a
End If
End If
可是为什么得不到呢?