Scrape yellowpages.com

时间:2015-03-25 23:08:44

标签: excel vba excel-vba web-scraping

我正在尝试使用以下代码使用VBA刮取yellowpages.com,但没有数据被记录

For Each ele In .document.all
Select Case ele.tagname
Case Results 
RowCount = RowCount + 1 
Case "Name" 
sht.Range("A" & RowCount)=ele.innerText
Case "Adress" 
sht.Range("A" & RowCount) = ele.innerText
Case "Email" 
sht.Range("A" & RowCount) = ele.innerText
End 
Select Next ele 
End With

结果只是空白没有错误

1 个答案:

答案 0 :(得分:0)

除非你有一个名为Results的变量,否则

Case Results是错误的。您可能希望Case "Results"代替

不确定这里的格式是否错误,但是:

End
Select Next ele

应该是

End Select
Next ele