I've been using a code I've made for scraping some data from some sites, now that I tried to add a new site to the list I get this error: Object doesnt support this property or method. Can I use the exact same code as others but this time I get this message, does anyone know why? The error message appears when I try to get the elementbyclassname.
Sub Zelo()
Dim dia As String
Dim mes As String
Dim ano As String
dia = "14"
mes = "09"
ano = "13"
Dim cont As Integer
Dim i As Integer
Dim URL As String
Dim IE As Object
IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
URL = "http://www2.zelo.com.br/weddingListSearch.aspx?dsName=&dsLocation=&dtWedding=" & dia & "/" & mes & "/" & ano & "&idproduct=&qty="
IE.Navigate(URL)
Do
DoEvents()
Loop Until IE.READYSTATE = 4
cont = 0
With IE
For Each ele In .document.getelementsbyclassname("name") ' Here I have the error message
If ele.classname = "place" Then
cont = cont + 1
End If
Next ele
End With
Sheets("Plan2").Range("A2") = cont
IE.Quit()
End Sub