Hi
i try to get data with the below code. it changes the dropdown menu and get data with this select.
But it works very slow. how can i make it faster.
i try to get data with the below code. it changes the dropdown menu and get data with this select.
But it works very slow. how can i make it faster.
VBA Code:
Sub web()
Dim objIE As Object
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = True
objIE.Navigate "https://www.isyatirim.com.tr/tr-tr/analiz/hisse/sayfalar/sirket-karti.aspx?hisse=AGHOL"
Do While objIE.Busy = True Or objIE.ReadyState <> 4: DoEvents: Loop
'1.KISIM
Set HTMLDoc = objIE.document
Set evtChange = HTMLDoc.createEvent("HTMLEvents")
evtChange.initEvent "change", True, False
Set selectElement = HTMLDoc.getElementById("ddlMaliTabloDonem1")
selectElement.Value = "2018/9"
selectElement.dispatchEvent evtChange
Do While objIE.Busy = True Or objIE.ReadyState <> 4: DoEvents: Loop
For I = 3 To 20
Range("b2") = "2018/9"
Application.Wait Now + TimeValue("00:00:02")
Cells(I, 2) = objIE.document.getElementById("tbodyMTablo").getElementsByTagName("tr")(I - 2).getElementsByTagName("td")(1).textContent
Application.Wait Now + TimeValue("00:00:02")
Cells(I, 1) = objIE.document.getElementById("tbodyMTablo").getElementsByTagName("tr")(I - 2).getElementsByTagName("td")(0).textContent
Do While objIE.Busy = True Or objIE.ReadyState <> 4: DoEvents: Loop
Next
End Sub