On this public website, depending on the selected federal state, 30 properties are listed on the right-hand side. If this federal state offers more than 30 properties, then another 30 are listed on the next page. The URL is then for example:
https://zvgscout.com/brandenburg?page=1
https://zvgscout.com/brandenburg?page=2
etc.
But when I try to parse the links to the properties with this code, I only get the 30 Objects that are listed on page 1, even if the URL is specified as Page=3:
Sub GetDataFromPublicSite()
Dim html As New HTMLDocument
Dim GetHref As String
Dim CountItems As Object
Dim x As Long, y As Long
With CreateObject("MSXML2.XMLHTTP.6.0")
.Open "GET", "https://zvgscout.com/brandenburg?page=3", False
.send
html.body.innerHTML = .responseText
End With
Set CountItems = html.querySelectorAll("a")
For y = 0 To CountItems.length - 1
If InStr(html.querySelectorAll("a").Item(y), "brandenburg") Then
GetHref = html.querySelectorAll("a").Item(y).href
End If
Next
End Sub
Can anyone help me? I would like to know how I can access the real estate links that are on pages 2,3,4…etc.
Thanks!