table inside frame, never used!!!
how to get data in table?
See image attached
MY TEST code:
Code:
Option Explicit
Sub TEST()
Dim http As New MSXML2.XMLHTTP60, html As New HTMLDocument
Dim topics As Object, topic As Object, posts As Object, post As Object, hd As Object
Dim x As Long, y As Long, z As Long
x = 2
y = 2
z = 2
With http
.Open "GET", "[URL unfurl="true"]https://coseerobe.gbvitrano.it/comuni-italiani-2021.html",[/URL] False
.send
html.body.innerHTML = .responseText
End With
Set topics = html.getElementsByTagName("table")
For Each topic In topics
For Each posts In topic.getElementsByTagName("tr")
For Each post In posts.getElementsByTagName("td")
Set hd = posts.getElementsByTagName("td")(0)
Debug.Print hd.innerText
Cells(z, 1) = hd.innerText
Cells(x, y) = post.innerText
Debug.Print post.innerText
y = y + 1
Next post
y = 2
x = x + 1
z = z + 1
Next posts
Next topic
End Sub