急问,如何得到网页上超链接?

lpf 2004-07-14 12:03:37
cell的超链接为这种格式:
<a href="#" class="a1" onclick="javascript:window.open('address','','top=100,left=150,resizable=no,scrollbars=yes,menubar=no,width=620,height=470');return false;">

请问我如何得到'address'部分?

Dim a

For Each a In WebBw.Document.All
If UCase(a.tagName) = "A" Then
Debug.Print a.herf
End If

Next

这种方法可以吗?

现在我想要的links均在同一table的一列上,如何能通过cells的属性得到其alink?

...全文
170 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
rainstormmaster 2004-07-14
  • 打赏
  • 举报
回复
思路没问题,继续写吧:)
lpf 2004-07-14
  • 打赏
  • 举报
回复
现在主要是想通过table里cells的属性得到其超链接
lpf 2004-07-14
  • 打赏
  • 举报
回复
Debug.Print a.href
hhjjhjhj 2004-07-14
  • 打赏
  • 举报
回复
Dim s, obT, obR, obC, i
i = 0


For Each obT In WebBrowser1.Document.body.children
If UCase(obT.tagname) = "TABLE" Then
For Each obR In obT.Rows
For Each obC In obR.Cells(i).children
If UCase(obC.tagname) = "A" Then
s = s & obC.onclick & Chr(10)
End If
Next
Next
End If
Next
MsgBox s

1,502

社区成员

发帖
与我相关
我的任务
社区描述
VB 网络编程
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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