我没有问题要下载一部特定的URL。
但我有一个伙伴关系。 互联网第一页必须检查报废数据,而有趣的数据则落在一个纽扣的后面。 我怎么能够模拟对该纽特的点击,并获取网络服务器将产生的数据?
纽瓦特人手法如下:
javascript:__doPostBack( ctl00$ctl01$DefaultSiteContentPlaceHolder1$Col1$ucNavBar$rptButtons$ctl00$btnPage , )
现在我正在利用这一伙伴关系。 获取特定URL内容的网络代码:
public string GetDataFromUrl(string strUrl)
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(strUrl);
request.Accept = "text/html, application/xhtml+xml, */*";
request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)";
request.KeepAlive = true;
using (StreamReader streamReader = new StreamReader(request.GetResponse().GetResponseStream(), Encoding.UTF8, true))
{
return streamReader.ReadToEnd();
}
}
页: 1
I have found a solution. Used the program Fiddler to be able to see exactly what happens when I clicked on the button. Then I tried to make a POST that looked so simular as the real call as possible.