Question Problem accessing link by using HttpWebRequest or WebBrowser

Joined
Apr 22, 2012
Messages
1
Programming Experience
1-3
Hello,

I have problem accessing links from a website. The site is Free TV Shows - A online, watch TV Shows - A online, watch TV Shows - A free on Tv-links.eu and a link that I need to access looks like this in html code : <a href="/tv-shows/Absolute-Power_25833/" class="list cfix"> <span class="c1">Absolute Power</span> <span class="c2">2003</span> </a> .

I try to access this link by forming the complete address : http://www.tv-links.eu/tv-shows/Absolute-Power_25833/, but when using either the HttpWebRequest class or the WebBrowser class, the page that is opened is the main page of the site, and not the one I give as a link.

Here is the code I use for HttpWebRequest :
//request to access the link
HttpWebRequest webReq = (HttpWebRequest)HttpWebRequest.Create(new Uri(link));


//the response
HttpWebResponse webRes = (HttpWebResponse)webReq.GetResponse();


//gets the stream of data from the response
Stream streamResponse = webRes.GetResponseStream();
StreamReader sr = new StreamReader(streamResponse);


content = sr.ReadToEnd();
sr.Close();
streamResponse.Close();


And for the webBrowser:
this.webBrowserForNavigation.Navigate(link);

Can someone offer instructions on how to access the intended link ?

Thank you.
 
Top Bottom