shahin
Active Member
Hi there! I've made a parser which is pulling 3 categories excluding Image and price out of five categories. I could not find any "img" tag there. Moreover the page contains lots of data but only 25 are being scraped. The page is loading slowly to display the full content though! Here is the code I've written. Any help would be a great help to me. Thanks in advance.
Code:
Sub VariousWines()
Const URL = "https://www.vivino.com/explore?e=eJzLLbI1UcvNzLM1NFDLTaywNTFQS660LS1WK7ZNTlQrS7YtKSpNVSsviY61NYRQRhDKGEKZQChzqJwJABUoGa4%3D"
Dim http As New MSXML2.XMLHTTP60, html As New HTMLDocument
Dim topics As Object, posts As Object, topic As HTMLHtmlElement, post As HTMLHtmlElement
Dim i As Long, x As Long
x = 2
http.Open "GET", URL, False
http.send
html.body.innerHTML = http.responseText
Set topics = html.getElementsByClassName("card card-lg")
For i = 0 To topics.Length - 1
Set topic = topics(i)
Cells(x, 1).Value = topic.getElementsByClassName("bold")(0).innerText
Cells(x, 2).Value = topic.getElementsByClassName("text-block wine-card__region")(0).innerText
Cells(x, 3).Value = topic.getElementsByClassName("text-inline-block light average__number")(0).innerText
Cells(x, 4).Value = topic.getElementsByClassName("wine-price-value")(0).innerText
On Error Resume Next
Cells(x, 5).Value = topic.getElementsByClassName("wine-card__image")(0).getElementsByTagName("img")(0).src
x = x + 1
Next i
End Sub
Last edited: