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. OpenWrt实现3DS的StreetPass Relay擦肩HomePass
  2. JCreator打包JAR可执行文档
  3. VBS获取文件的SDDL字符串
  4. VBS十年未解之谜
  5. VBS中TextStream对象的ReadLine方法

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的拒绝访问

留下回复