I am trying to scrape data from this website. I am almost done. But for a href that is located in child element that i am not able to reach. Please run the code below. There should be an error "object doesn't support this property or method". I tried ele.children.href NOT SOLVED. Thanks in advance!


Sub test()
Dim eRow As Long
Dim ele As Object
Dim Rowcount As Long
Set sht = Sheets("Sheet1")
sht.Range("P" & 1) = 1
Rowcount = sht.Range("P" & 1).Value

'sht.Range("A" & RowCount) = "Number"
'sht.Range("B" & RowCount) = "Link"
'sht.Range("C" & RowCount) = "Position"
'sht.Range("D" & RowCount) = "Company"
'sht.Range("E" & RowCount) = "Location"
'sht.Range("F" & RowCount) = "Zip"
'sht.Range("G" & RowCount) = "Description"
'sht.Range("H" & RowCount) = "Time"
'sht.Range("I" & RowCount) = "Indeed resume"

'eRow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Set objIE = CreateObject("InternetExplorer.Application")

With objIE
.Visible = True
.navigate "http://www.indeed.com/jobs?q=manufacturing+engineer&fromage=last/"

Do While .Busy Or _
.readyState <> 4
DoEvents
Loop


For Each ele In .document.all
    

Select Case ele.classname
Case "  row  result"
Rowcount = Rowcount + 1
sht.Range("A" & Rowcount) = Rowcount - 1
Case "row sjlast result"
Rowcount = Rowcount + 1
sht.Range("A" & Rowcount) = Rowcount - 1
Case "row  result"
Rowcount = Rowcount + 1
sht.Range("A" & Rowcount) = Rowcount - 1
Case "jobtitle"
sht.Range("B" & Rowcount) = ele.href
sht.Range("C" & Rowcount) = ele.innertext
Case "jobtitle turnstileLink"
sht.Range("B" & Rowcount) = ele.href
sht.Range("C" & Rowcount) = ele.innertext
Case "company"
sht.Range("D" & Rowcount) = ele.innertext
Case "location"
sht.Range("E" & Rowcount) = ele.innertext
Case "summary"
sht.Range("G" & Rowcount) = ele.innertext
Case "date"
sht.Range("H" & Rowcount) = ele.innertext
Case "iaLabel"
sht.Range("I" & Rowcount) = ele.innertext
End Select

sht.Range("P" & 1) = Rowcount

Next ele

End With

Macro1
Set objIE = Nothing
End Sub

Sub Macro1()
'
' Macro1 Macro
' Formatting imported data
'
'
Columns("A:D").Select
Selection.Columns.AutoFit
With Selection
.VerticalAlignment = xlTop
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
End With
Range("D1").Select
Columns("D:D").ColumnWidth = 50
Columns("A:D").Select
Selection.Rows.AutoFit
End Sub