From: Masaki Suketa Date: 2005-09-12T19:39:07+09:00 Subject: [ruby-list:41134] Re: win32oleで作成したIEの子ウィンドウの取得 助田です。 In message "[ruby-list:41128] win32oleで作成したIEの子ウィンドウの取得" on 05/09/11, Hidenori Hashizume writes: >  win32oleで作成したInternet Explorerのウィンドウの子ウィンドウへの参照 > を取得する方法は無いでしょうか。 子ウィンドウへの参照を取得する方法は、わからなかったのですが、 Shell.Application を使ってみる方法じゃ駄目でしょうか? ---- Ruby スクリプト ----- 'win32ole' ie = WIN32OLE.new('InternetExplorer.Application') ie.visible = true ie.Navigate("http://localhost/test01.html") while(ie.busy) sleep 3 end # # ここで適当に少しだけsleepしないと、test01.htmlから # onloadイベントで開かれるウェブブラウザが # shell.Windowsでリストアップされない。 # sleep 1 shell = WIN32OLE.new("Shell.Application") windows = shell.Windows windows.each do |w| if w.document.ole_type.name == 'DispHTMLDocument' puts w.busy puts w.locationURL end end --------------------------- ---- test01.html ---- test01.html Open new window and access to Google site. ----------------------