- Excel VBA 質問スレ Part41©2ch.net
217 :209[sage]:2016/05/13(金) 19:41:39.39 ID:mSOPxExz - すみません。以下ソースです。
Dim objIE As InternetExplorer Set objIE = CreateObject("InternetExplorer.Application") objIE.Visible = True objIE.navigate "http://hogehoge.jp" Do While objIE.Busy = True Or objIE.readyState <> 4 DoEvents Sleep 1 If Now > timeOut Then objIE.Refresh timeOut = Now + TimeSerial(0, 0, 20) End If Loop timeOut = Now + TimeSerial(0, 0, 20) Do While objIE.document.readyState <> "complete" DoEvents Sleep 1 If Now > timeOut Then objIE.Refresh timeOut = Now + TimeSerial(0, 0, 20) End If Loop Sleep 10000 For Each objtag In objIE.document.getElementsByTagName("a") If InStr(objtag.outerHTML, "○○") > 0 Then objtag.Click Exit For End If Next 同ページ内の○○というリンクをクリックしてそのページに移動します。そして、移動したページから次のページに移動させるにもieの制御ができないのです。 上記の objtag.ClickやobjIE.document.Links(1).Clickを使っても無反応です。
|