当前位置:编程学习 > C#/ASP.NET >>

抓取手机浏览URL的title

            HttpWebRequest oplrequest = (HttpWebRequest)WebRequest.Create(网址);
            oplrequest.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
            oplrequest.ContentType = "application/x-www-form-urlencoded";
            oplrequest.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)";
            oplrequest.Method = "GET";
            oplrequest.KeepAlive = true;
            oplrequest.CookieContainer = new CookieContainer();
            oplrequest.AllowAutoRedirect = true;
            oplrequest.CookieContainer = cookiecont;

            HttpWebResponse oplresponse = (HttpWebResponse)oplrequest.GetResponse();
            Stream oplresstream = oplresponse.GetResponseStream();
            StreamReader oplsr = new StreamReader(oplresstream, Encoding.GetEncoding("utf-8"));
            string oplHTML = oplsr.ReadToEnd();
            oplresstream.Close();
            oplsr.Close();
            oplresponse.Close();

大部分能抓取,可是还有一些抓不了,尤其是go.10086.cn和ti50.3g.qq.com,求各位大神help me。。。。



--------------------编程问答-------------------- 自己先把他顶起来... --------------------编程问答-------------------- UP..............
补充:.NET技术 ,  C#
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,