如何恢復頁面的完整html,包括javascript生成的內容。問題是我想訪問select標籤的內容,但頁面卻是空的,這可能是動態生成的。請我放棄! 我剛剛發佈了一段代碼,因爲這非常大,如果我覺得有必要把整個代碼。如何恢復頁面的完整html,包括javascript生成的內容
res = (HttpWebResponse)req.GetResponse();
res.Cookies = req.CookieContainer.GetCookies(req.RequestUri);
cookieContainer.Add(res.Cookies);
sr = new StreamReader(res.GetResponseStream());
getHtml = sr.ReadToEnd();
viewstate = rxViewstate.Match(getHtml).Groups[1].Value;
EventValdidation = rxEventValidation.Match(getHtml).Groups[1].Value;
viewstate = HttpUtility.UrlEncode(viewstate);
EventValdidation = HttpUtility.UrlEncode(EventValdidation);
//Here I should take the contents of the select tag.
getHtml = rxDropDownMenu.Match(getHtml).Groups[2].Value;
http://phantomjs.org/ – I4V
我忘了說,對不起,如果在這個問題上有錯誤,我用翻譯爲什麼不寫英文很好。我是巴西人。 – Patterson
您必須評估JavaScript服務器端,並獲取操縱的DOM對象。 – crush