0
私はウェブサイトから回答をコピーしようとしていますが、ページを更新できるようにドロップダウンリストからオプションの1つを選択する必要があります。Excel VBAオプションWebサイトのドロップダウンリストとクリックを選択
これまでのところ、私はIEを開いてドロップダウンボタンをクリックすることができましたが、その理由を知らないオプションを選択することはできません。以下のコードのサンプルをご覧ください。
Sub OpenWebSelectClickSaveHtmlFile()
Dim URL As String
URL = "http://formulaacademia.com.br/academia"
Set myIE = CreateObject("InternetExplorer.Application")
With myIE
.navigate URL
.Visible = True
Do While .Busy = True Or .readyState <> 4
Loop
DoEvents
Set selectitems = myIE.document.getElementsByTagName("button")
For Each i In selectitems
i.Click
Next i
End With
End Sub
RGDS
'DoEvents'を' Do ... Loop'の中に置きます。最終的に回答から取り出す予定のデータは何ですか? IEの代わりにXHRを使用する方が良い解決策かもしれません。 – omegastripes