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. 三星官方Android 5.0 Lollipop系统Deodex化及刷Xposed
  2. .htaccess文件初探
  3. 用VBS实现繁体中文和简体中文转换
  4. JavaScript中的闭包(closures)
  5. 确定Windows XP到底是UCS-2的还是UTF-16的

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

留下回复