データをスクレイピングすることはできますが、更新ボタンをクリックする方法がわかりません。
Web ページでは、Osvježi と書かれたボタンです。
これはウェブページです: https://zse.hr/default.aspx?id=10006&dionica=1027
これはHtml行です:
<input type="submit" value="Osvježi" class="btnSubmit2">
これは VBA コードです。
Sub zse()
Dim ie As InternetExplorer, htmle As IHTMLElement
Dim i As Integer
i = 1
Set ie = New InternetExplorer
ie.Visible = True
ie.navigate "https://zse.hr/default.aspx?id=10006&dionica=259"
Do While ie.Busy = True Or ie.readyState <> READYSTATE_COMPLETE
Application.Wait Now + TimeValue("00:00:02")
Loop
ie.document.getElementById("DateFrom").Value = "1.1.2010"
ie.document.getElementsByClassName ("btnSubmit2")
Debug.Print ie.document.getElementById("btnSubmit2")
For Each htmle In ie.document.getElementsByClassName("standard-table sorttable")(0).getElementsByTagName("tr")
With ActiveSheet
.Range("a" & i).Value = htmle.Children(0).textContent
.Range("b" & i).Value = htmle.Children(1).textContent
.Range("c" & i).Value = htmle.Children(2).textContent
.Range("d" & i).Value = htmle.Children(3).textContent
.Range("e" & i).Value = htmle.Children(4).textContent
.Range("f" & i).Value = htmle.Children(5).textContent
.Range("g" & i).Value = htmle.Children(6).textContent
.Range("h" & i).Value = htmle.Children(7).textContent
.Range("i" & i).Value = htmle.Children(8).textContent
.Range("j" & i).Value = htmle.Children(9).textContent
.Range("k" & i).Value = htmle.Children(10).textContent
End With
i = i + 1
Next htmle
End Sub