|
[ruby-list:41134] Re: win32oleで作成したIEの子ウィンドウの取得: msg#00053lang.ruby.japanese
助田です。 In message "[ruby-list:41128] win32oleで作成したIEの子ウィンドウの取得" on 05/09/11, Hidenori Hashizume <hide-tech-ZQFY+njjMBnpVH8W3JqS+w@xxxxxxxxxxxxxxxx> 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 ---- <html> <head> <title>test01.html</title> <Script Language="javascript"> <!-- function open_window() { window.open('http://www.google.com') } --> </Script> </head> <body onload="open_window()"> Open new window and access to Google site. </body> </html> ----------------------
|
|
<Prev in Thread] | Current Thread | [Next in Thread> |
---|---|---|
Previous by Date: | [ruby-list:41133] Re: MySQLクラスのquieryの比較について。, とみたまさひろ |
---|---|
Next by Date: | [ruby-list:41135] Re: win32oleで作成したIEの子ウィンドウの取得, Masaki Suketa |
Previous by Thread: | [ruby-list:41128] win32oleで作成したIEの子ウィンドウの取得, Hidenori Hashizume |
Next by Thread: | [ruby-list:41135] Re: win32oleで作成したIEの子ウィンドウの取得, Masaki Suketa |
Indexes: | [Date] [Thread] [Top] [All Lists] |