VB使用WebBrowser读取网页中iframe的内容

标签: , , ,

Set iframe = WebBrowser1.Document.frames(i).Document
Debug.Print iframe.documentElement.innerHTML
iframe.getElementsByName("username")(0).Value = "demon"

其实和JavaScript没什么区别,都是HTML DOM操作。

赞赏

微信赞赏支付宝赞赏

随机文章:

  1. VBS获取硬件信息
  2. 用VBS生成GUID
  3. 用Visual C++ 6.0(VC6)编译Notepad2
  4. Windows 7系统下安装Visual Studio 2015/2017/2019
  5. OpenWrt搭建KMS服务器激活Windows和Office

5 条评论 发表在“VB使用WebBrowser读取网页中iframe的内容”上

  1. 雨中风铃说道:

    Set ie = WScript.CreateObject(“InternetExplorer.Application”)
    ie.Visible = True
    IE.Navigate “http://www.hercity.com/s/201105/12741.html”

    Do While ie.readystate4
    Wscript.Sleep 200
    Loop

    Set Frames = ie.Document.Frames
    For i=0 To Frames.Length-1
    msgbox Frames(i).Document.body.innerHTML
    Next

    ie.quit
    Set ie = Nothing

  2. 雨中风铃说道:

    VBS的拒绝访问

留下回复