2
當我嘗試加載以下頁面:HttpWebRequest和JavaScript的
http://www.manta.com/c/mm0mg7z/law-office-of-wendy-kazel
與HttpWebRequest的(我用下面的代碼)
try {
HttpWebRequest _wReq;
HttpWebResponse _wResp;
System.IO.StreamReader _sr;
System.Text.ASCIIEncoding _enc = new System.Text.ASCIIEncoding();
_wReq = (HttpWebRequest) WebRequest.Create("http://www.manta.com/c/mm0mg7z/law-office-of-wendy-kazel");
_wReq.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
_wReq.Timeout = 20000;
_wReq.ReadWriteTimeout = 20000;
_wReq.Referer = "http://www.manta.com";
_wResp = (HttpWebResponse) _wReq.GetResponse();
_sr = new System.IO.StreamReader(_wResp.GetResponseStream());
_html = _sr.ReadToEnd();
_sr.Close();
_wResp.Close();
} catch (WebException ee) {
}
我從曼塔
以下返回的HTMLOops.
Before you can move on, please activate JavaScript.
它並不總是發生,但大部分時間。
任何想法可能是什麼問題?
我認爲該網站取決於JavaScript,_html代表什麼? –
_html是請求的html源代碼 – Elvin
對不起,我的意思是_html是如何使用的?如果_html是一個變量,你是如何創建它的?是否有用於創建此變量/對象的特定代碼? –