getting source code of redirected http site via c# webclient
i have problem with certain site - i am provided with list of product ID
numbers (about 2000) and my tak is to pull data from producent site. I
already tried forming url of product pages, but there are some unknown
variables that i cant put to get results. However there is search field so
i can use url like this:
http://www.hansgrohe.de/suche.htm?searchtext=58143000 - the problem is,
that given page display info (probably java script) and then redirect
straight to desired page - the one that i need to pull data from.
is there any way of tracking this redirection thing?
i would like to put some of my code, but everything i got so far, i find
unhelpfull because it just download source of preredirected page.
public static string Download(string uri)
{
WebClient client = new WebClient();
client.Encoding = Encoding.UTF8;
client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.2; .NET CLR 1.0.3705;)");
string s = client.DownloadString(uri);
return s;
}
Also suggested answer is not helpfull in this case, because redirection
doesn't come with http request - page is redirected after few seconds of
loading http://www.hansgrohe.de/suche.htm?searchtext=58143000 url
No comments:
Post a Comment