获取网页数据

jp0077777 2010-05-23 01:18:44
网页数据中有一值为
<TD class=ttButton onclick="interface_t(null, 116906022, 3, 'L', this)" align=middle>

null, 116906022, 3, 'L', this

的值我可以得到 但是如果得到116906022这个数字呢?



For Each ttt In WebBrowser1.document.document.All
aaa=ttt.click


然后aaa="null, 116906022, 3, 'L', this"

但这样得到116906022这个值太麻烦了 我想更直接一点得到 有办法吗?谢了
...全文
71 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
jp0077777 2010-05-24
  • 打赏
  • 举报
回复
已经不需要了 我通过其它的办法解决了 不过好像正则比较好 但我熟 谢了
无·法 2010-05-23
  • 打赏
  • 举报
回复
Private Sub Form_Load()
Dim reg As Object, matchs As Object
Set reg = CreateObject("vbscript.regexp")
reg.Pattern = "onclick.*?(\d+)"
Set matchs = reg.Execute("<TD class=ttButton onclick=""interface_t(null, 116906022, 3, 'L', this)"" align=middle>")
MsgBox matchs(0).SubMatches(0)
End Sub
chinaboyzyq 2010-05-23
  • 打赏
  • 举报
回复
Private Sub Command1_Click()
aaa = "interface_t(null, 116906022, 3, 'L', this)"
bbb = Mid(aaa, InStr(aaa, ",") + 1, InStr(InStr(aaa, ",") + 1, aaa, ",") - InStr(aaa, ",") - 1)
MsgBox bbb

End Sub
jp0077777 2010-05-23
  • 打赏
  • 举报
回复
具体一点啊 我没有听明白
threenewbee 2010-05-23
  • 打赏
  • 举报
回复
正则表达式匹配.

7,762

社区成员

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

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