使用httpwebrequest获取网页
http://www.9588.com/FlightTicket/waiting.aspx?StartCity=SZX&ArrivalCity=TAO&FlyDate=2009-05-15&FlyTime=00:00&AirCompany=&cooperateid=18273
结果他又跳转到另外的页面了。如何能得到他真正的查询页面呢?
 
请求达人指点,有源码更好了~

解决方案 »

  1.   

    他这个网页有来路判断,你可以伪造来路到httpwebrequest,这样就可以了。
      

  2.   

    你那个网址是get提交啊,要post的话按下面实例来修改好了,
    截取的结果:
    POST /FlightTicket/waiting.aspx HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-silverlight, */*
    Referer: http://www.9588.com/FlightTicket/query.aspx
    Accept-Language: zh-cn
    Content-Type: application/x-www-form-urlencoded
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
    Host: www.9588.com
    Content-Length: 109
    Connection: Keep-Alive
    Cache-Control: no-cache
    Cookie: ASP.NET_SessionId=dyyyvr55gexvpgv0nskt1245; CityCode=StartCityCode=SZX&ArrivalCityCode=TAO&SailType=0&AirCompany=; __utma=61334500.1357444250.1242033837.1242033837.1242033837.1; __utmb=61334500; __utmc=61334500; __utmz=61334500.1242033837.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none)FlyWay=0&StartCity=SZX&ArrivalCity=TAO&FlyDate=2009-05-15&FlyReturnDate=2009-5-13&FlyTime=06%3A00&AirCompany=
      

  3.   

    还是有点不明白楼上的意思,问题是我要获取的页面跳转了,我获取的只是这个页面。我怎么让webrequest也跟着跳转呢?希望达人们多给点提示。