开发者

how to get a full html source?

开发者 https://www.devze.com 2023-04-13 00:24 出处:网络
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:

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 = HttpWebReques开发者_开发技巧t.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();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消