我試圖拉動以下網站的信息:http://gis.calhouncounty.org/ParcelViewer/index.html。如果您輸入PPIN 66078,然後點擊房產稅,它將顯示數據。我正試圖在VBA中重新創建這個SOAP請求,但未成功。它調用服務,但響應中的所有數據都是空白的。我非常沮喪,甚至重新創建了完整的標題集,但無濟於事。也許有一個cookie問題,但我的電腦上的cookies似乎不會很快過期。這裏是我在提取:通過VBA的SOAP
URL = "http://gis.calhouncounty.org/wsCalhounParcel2/Inquiry.asmx?WSDL"
method = "getTaxBill"
parcel = Range("A" & currentrow).Value
SoapRequest = SoapRequest & "<?xml version=""1.0"" encoding=""utf-8""?><soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""> "
SoapRequest = SoapRequest & "<soap:Body>"
SoapRequest = SoapRequest & "<tns:" & method & " xmlns:tns=""http://gis.calhouncounty.org"">"
SoapRequest = SoapRequest & "<tns:PPIN>" & parcel & "</tns:PPIN>"
SoapRequest = SoapRequest & "</tns:" & method & ">"
SoapRequest = SoapRequest & "</soap:Body>"
SoapRequest = SoapRequest & "</soap:Envelope>"
Set objHTTP = CreateObject("Msxml2.XMLHTTP")
objHTTP.Open "POST", URL, False
objHTTP.setRequestHeader "Host", "gis.calhouncounty.org"
objHTTP.setRequestHeader "Connection", "keep-alive"
objHTTP.setRequestHeader "Content-Length", SoapRequestLen
objHTTP.setRequestHeader "Origin", "http://gis.calhouncounty.org"
objHTTP.setRequestHeader "X-Requested-With", "ShockwaveFlash/17.0.0.169"
objHTTP.setRequestHeader "SOAPAction", "http://gis.calhouncounty.org/" & method
objHTTP.setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36"
objHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
objHTTP.setRequestHeader "Accept", "*/*"
objHTTP.setRequestHeader "Referer", "http://gis.calhouncounty.org/ParcelViewer"
objHTTP.setRequestHeader "Accept-Encoding", "gzip, deflate"
objHTTP.setRequestHeader "Accept-Language", "en-US,en;q=0.8"
objHTTP.setRequestHeader "Cookie", "ASPSESSIONIDAABARSAB=DIIJLAGCFJKDFKBCDNMMLEIB; ASPSESSIONIDAAACQSBA=BKAJPFCDCAJLBAKFFBACBMGC; ASPSESSIONIDCCCBRTBA=DKJPBAPDNLIFBOJGCPEDMAHG; __utma=262294995.1570768928.1429018531.1429018531.1430173329.2; __utmc=262294995; __utmz=262294995.1430173329.2.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); ASPSESSIONIDAQTRATAB=OHCBMBMCNALFKOCODDMIAHIA; _ga=GA1.2.90452212.1429018592; __utmt=1; __utma=167846455.90452212.1429018592.1430173349.1430248358.4; __utmb=167846455.1.10.1430248358; __utmc=167846455; __utmz=167846455.1430173349.3.3.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)"
objHTTP.send SoapRequest
任何幫助是令人難以置信的讚賞! -Andy