51Testing软件测试论坛

标题: 如何获得"InternetExplorer.Application"的接口? [打印本页]

作者: yujianan1984    时间: 2010-1-26 23:27
标题: 如何获得"InternetExplorer.Application"的接口?
有如下段代码,想知道如何获得IE的com接口和属性,谢谢了!

package require tcom
set application [::tcom::ref createobject "InternetExplorer.Application"]
$application Visible 1
proc query {application url} {
    if {[string equal $url [$application LocationURL]]} {
        $application Refresh
    } else {
        $application Navigate $url
    }
    while {[$application Busy]==1} {
        after 200
    }

set int [::tcom::info interface $application]
    set H_Document [$application  Document]
    puts "dddd==$H_Document"
    set I_Document [::tcom::info interface $H_Document]
    #all methods the handle supports [$I_Document methods]
    set H_body [$H_Document body]
    # ??????????
    #return [$H_body innerHTML]
}
set url "http://www.sina.com.cn"

regexp {torrentmeta_id=(\d+)} $url match id
set content [query $application $url]




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2