how to get a full html source?

北城余情 提交于 2019-12-09 21:19:27

问题


my name is loran and i'm using asp.net - c# in my project. i'm trying getting the exactly html source from a facebook page: (http://www.facebook.com/search.php?q=loranzur%40yahoo.com). i'm trying to get the id number into a string variable (in the source you can search for : Profile.php?id= ).

i succeed to copy the source to a string variable using WebClient or HttpWebRequest, but the resaults is not the same as i open the "view source" by myself. the source that i copied to the the variable was missing a lot of data (the id number is one example). is there any option to copy the full source of this page so i will have the accessibility to this number from a string variable ??? thanks..

this is one of the codes that i'm using but its not so usefull:

WebRequest req = HttpWebRequest.Create("http://www.facebook.com/search.php?q=loranzur%40yahoo.com");    
req.Method = "GET";    
string source;
using (StreamReader reader = new StreamReader(req.GetResponse().GetResponseStream()))
{
        source = reader.ReadToEnd();
}

来源:https://stackoverflow.com/questions/7740095/how-to-get-a-full-html-source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!