日期:2014-05-17  浏览次数:20841 次

抓取网页问题
HTML code

<form action="http://fccx.runsky.com/app/chushouSearch.php"  name="SaleSearchForm" method="post">
  <select name="paixu">
    <option value="">请选择排序方式</option>
    <option value="1" >按时间排序</option>
    <option value="2" >按价格由高到低</option>
    <option value="3" >按价格由低到高</option>
    <option value="4" >按面积由高到低</option>
    <option value="5" >按面积由低到高</option>
  </select>
  <input type='hidden' name='houseFlag' value='0'/>
  <input type='hidden' name='randid' value='20.0.0.18013234048941874285921'/>
  <input name='page' value='30'/>
  <input type="submit" value="提交" />
</form>


VBScript code

<%
PostData = "paixu=1&houseFlag=0&randid=20.0.0.18013234048941874285921&page=3"
Set HTTPReq = Server.createobject("Msxml2.XMLHTTP")
HTTPReq.Open "POST", "http://fccx.runsky.com/app/chushouSearch.php?", False   
HTTPReq.setRequestHeader "Content-Length",Len(PostData)
HTTPReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
HTTPReq.setRequestHeader "Referer", RefererUrl
HTTPReq.Send PostData

Response.Write(Bytes2bStr(HTTPReq.responseBody))

Function Bytes2bStr(vin) 
  Dim BytesStream, StringReturn 
  Set BytesStream = Server.CreateObject("ADODB.Stream") 
  BytesStream.Type = 2 
  BytesStream.Open 
  BytesStream.WriteText vin 
  BytesStream.Position = 0 
  BytesStream.Charset = "utf-8" 
  BytesStream.Position = 2 
  StringReturn = BytesStream.ReadText 
  BytesStream.close 
  Set BytesStream = Nothing 
  Bytes2bStr = StringReturn 
End Function
%>



用html就好使,用asp就出错,怎么解决此问题,希望能够用asp取得对方不同页的内容。

------解决方案--------------------
测下来asp抓页面是可以的,只是其本身查询出错, 用FROM也一样出错
Warning: oci_execute() [function.oci-execute]: ORA-00900: invalid SQL statement in /data/app/chuzusearch.runsky.com/app/chushouSearch.php on line 454
Warning: oci_fetch_array() [function.oci-fetch-array]: ORA-24374: define not done before fetch or execute and fetch in /data/app/chuzusearch.runsky.com/app/chushouSearch.php on line 481

------解决方案--------------------
runsky.com本身查询错误,跟你那边没关系。