有个windows C#问题!
我想用c#语言获取某个页面的html源文件数据,结果发现页面前台显示某些数据,而在得到的源文件代码中却找不到这些数据,我想可能是网站后台用JS写的,也可能是其它方法,那我怎么才能获取到这些数据呢?

解决方案 »

  1.   

    如果通过html源码方式获取不到的话,
    可以通过抓包的方式来看看是否可以得到
      

  2.   

    public Stream GetHttpStream(string pUrl, int pTimeout)

    // handle on the remote resource 
    HttpWebRequest wr = (HttpWebRequest) WebRequest.Create(pUrl); 
    // set the HTTP properties 
    wr.Timeout = pTimeout * 1000; // milliseconds to seconds 
    // Read the response 
    WebResponse resp = wr.GetResponse(); 
    // Stream read the response 
    return(resp.GetResponseStream()); 

    试一下这个,直接根据url获取页面内容。再将得到的steam转换为想要的数据类型就行