Tag: scraping xmlhttprequest

在VBA中使用XMLHTTP从多个页面parsing/刮取

下面的代码只抓取/parsing一页数据(50结果)到Excel中,但是,我想它刮了多个页面(500结果) – 请帮助。 (Base64Encode是从另一个来源采取的 – 我不赞赏它) `Function GetData() As Boolean Application.ScreenUpdating = False Dim objHTTP As New MSXML2.XMLHTTP Dim strURL As String Dim strUserName As String Dim strPassword As String Sheet1.Range("A2:R2000") = "" Sheet1.Activate strUserName = "User" strPassword = "Password" For i = 1 To UBound(MyArray) strURL = "https://.ngx.com/ngxcs/indexPrice.xml" objHTTP.Open "GET", strURL, False objHTTP.setRequestHeader "Authorization", […]

VBA HTTP请求需要10多秒

任何人都可以阐明为什么这段代码需要这么长时间才能加载? 我已经在浏览器中试过了,加载只需要大约4秒钟的时间。 有没有什么办法,我可以禁用在VBA网页抓图加载图像? (请注意,等待是在send线,这需要超过10秒的加载,这在我的脑海里是过度的?) Sub FetchIndividualURL() Dim XMLHTTP as Object Dim HTMLdoc as Object Set XMLHTTP = CreateObject("MSXML2.serverXMLHTTP") URL = "http://www.gumtree.com.au/s-ad/lansvale/cars-vans-utes/2011-subaru-forester-x-grey-wagon/1106783884" With XMLHTTP .Open "GET", URL, False .setRequestHeader "Content-Type", "text/xml" .send Set HTMLdoc = CreateObject("HTMLFile") HTMLdoc.body.innerhtml = .responsetext End With End Sub