Silent_Warrior5
New Member
- Joined
- Aug 11, 2018
- Messages
- 4
Hi all,
i will load data from a html website. the problem is i can not use "CreateObject("InternetExplorer.Application")" because the site don't load in the internet explorer. In Firefox the side works.
i need all data in the blue boxes from all 4 Areas
i test it with getElementsByTagName and getElementById but dont work
can someone help me?
thx and cheers
silent
i will load data from a html website. the problem is i can not use "CreateObject("InternetExplorer.Application")" because the site don't load in the internet explorer. In Firefox the side works.
i need all data in the blue boxes from all 4 Areas
i test it with getElementsByTagName and getElementById but dont work
can someone help me?
VBA Code:
Sub Extract_data()
Dim url As String, links_count As Integer
Dim i As Integer, j As Integer, row As Integer
Dim XMLHTTP As Object, html As Object
Dim tr_coll As Object, tr As Object
Dim td_coll As Object, td As Object
links_count = 1
For i = 0 To links_count
url = ""
Set XMLHTTP = CreateObject("MSXML2.XMLHTTP")
XMLHTTP.Open "GET", url, False
XMLHTTP.send
Set html = CreateObject("htmlfile")
html.body.innerHTML = XMLHTTP.responseText
Set tbl = html.getElementsByTagName("location-container")
Set tr_coll = tbl(0).getElementsByTagName("TD")
For Each tr In tr_coll
j = 1
Set TD_col = tr.getElementsByTagName("TD")
For Each td In TD_col
Cells(row + 1, j).Value = td.innerText
j = j + 1
Next
row = row + 1
Next
Next
MsgBox "Done"
End Sub
thx and cheers
silent