This is an ebay page
I am using C# agility pack to get the 'print' version page from this link . 'Print' link is at the middle right side of this page . Agilitypack is returning this link :
When I am loading this link its returning another page , not the actual one . Though clicking on 'print' works well . As far as i understand 'print' link is being redirected to another page. I have checked some solution of stackoverflow . not worked for this case . There is a .dll file in the link/path . Any suggestion to solve this problem ??
thanks in advance
The link points to http://cgi.ebay.com/
which redirects to http://www.ebay.com/itm/
the rest of the URL is identical, so you can just use string.Replace("http://cgi.ebay.com/", "http://www.ebay.com/itm/")
Or if you want to do it cleanly, use this code:
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(print_url);
HttpWebResponse myResp = (HttpWebResponse)req.GetResponse();
string new_print_url = myResp.ResponseUri;