Hi, I'm a beginner with Excel and I am trying to get data from a web page into my spreadsheet using VBA. I've managed to navigate to a search results page but am unable to access the data. The source code for one instance in the results list is:
<li><b>154 Morris Ave</b>, Summit City, NJ<br>
Block: <A HREF=" Lot:
<A HREF="17</A><br>
Google Map : <a href="javascript:void()" onClick="mappopup('154 Morris Ave, Summit City, NJ');">Click Here!</a><br>
Width: 66 X Depth: 102 Land: 56,500.00 Build: 147,700.00 Total <b>$204,200.00</b><br>
Sold: <b>$1.00</b> on <b>03/05/2007</b> BOOK: 5639
PAGE: 277
<br>
$0.00 - **/**/****
$0.00 - **/**/****
$0.00 - **/**/****<br>
<A HREF=" target="_blank">Census Tract Info</A> (opens in new window)<br>
<br>
My VBA code is:
For Each ele In .document.all
Select Case ele.classname
Case "????"
RowCount = RowCount + 1
Case "Address"
sht.Range("A" & RowCount) = ele.innertext
Case "Block"
sht.Range("B" & RowCount) = ele.innertext
Case "Lot"
sht.Range("C" & RowCount) = ele.innertext
Case "Width"
sht.Range("D" & RowCount) = ele.innertext
Case "Depth"
sht.Range("E" & RowCount) = ele.innertext
End Select
Next ele
End With
Set objie = Nothing
End Sub
Thank You in advance!
<li><b>154 Morris Ave</b>, Summit City, NJ<br>
Block: <A HREF=" Lot:
<A HREF="17</A><br>
Google Map : <a href="javascript:void()" onClick="mappopup('154 Morris Ave, Summit City, NJ');">Click Here!</a><br>
Width: 66 X Depth: 102 Land: 56,500.00 Build: 147,700.00 Total <b>$204,200.00</b><br>
Sold: <b>$1.00</b> on <b>03/05/2007</b> BOOK: 5639
PAGE: 277
<br>
$0.00 - **/**/****
$0.00 - **/**/****
$0.00 - **/**/****<br>
<A HREF=" target="_blank">Census Tract Info</A> (opens in new window)<br>
<br>
My VBA code is:
For Each ele In .document.all
Select Case ele.classname
Case "????"
RowCount = RowCount + 1
Case "Address"
sht.Range("A" & RowCount) = ele.innertext
Case "Block"
sht.Range("B" & RowCount) = ele.innertext
Case "Lot"
sht.Range("C" & RowCount) = ele.innertext
Case "Width"
sht.Range("D" & RowCount) = ele.innertext
Case "Depth"
sht.Range("E" & RowCount) = ele.innertext
End Select
Next ele
End With
Set objie = Nothing
End Sub
Thank You in advance!