1
私はMsxml2.XMLHTTPが動作しないように非常に複雑なウェブサイトにアクセスしています。私はfollowint Ie Automationを試みた。必要なテキストがインターネットエクスプローラにロードされているか確認してください
'Working
with createobject("internetexplorer.application")
.navigate url
Do While .ReadyState = 4: WScript.Sleep 1000: Loop
Do While .ReadyState <> 4: WScript.Sleep 1000: Loop
.document.body.createtextrange.select
.document.execCommand "copy"
strURL = .document.parentwindow.clipboardData.GetData("text")
.quit
end with
MsgBox strURL
しかし、このたびはinstr(strURL, "some text") is true
まで
私は、Webページをロードする場合Failproof Wait for IE to loadで未回答のように完全なコンテンツをロードし、どのような方法はありますか?
なぜ.ReadyState = 4
がページをロードしないのか分かりません。 JavaScriptの準備ができていない可能性がありますか?
このようにもう1つ寝ました。
If Not instr(strtxt, "some Text") > 0 then
WScript.Sleep 10000
.document.body.createtextrange.select
.document.execCommand "copy"
strtxt = .document.parentwindow.clipboardData.GetData("text")
私の環境ではほとんどの場合結果が得られますが、必要なテキストがロードされるまでチェックする方法はありません。