WebRequest and WebResponse has issues

Discussion in 'C#' started by Complete, Oct 25, 2012.

  1. Complete

    Complete New Member

    Jan 13, 2006
    Likes Received:
    Trophy Points:
    WebRequest and WebResponse has issues

    I wrote a C# program that uses WebRequest and WebResponse to perform a simple web crawler. I discovered something about web sites. Web browsers such as IE and FireFox offer the capacity to view the HTML source code. But it seems that html code that is sent to the browser is one thing and what the browser interprets and displays is something else. For example, if you run a google search in IE and run the same google search in FireFox, the content that you can see when you view the source in IE will NOT have the hyperlinks and content from the search results, but you can see the html hyperlinks and content from the search results when you view the source in FireFox. So my question is this. How do you specialise the WebRequest and WebResponse to show the content after it is processed by the browser instead of before?

    One possible solution might be to use HttpWebRequest instead of WebRequest and use the UserAgent property to somehow trick C# into thinking I am using the Firefox browser. But this does not seem to me to plausable.

    I also tried the WebBroswer control without setting it to visible, but I don't know the syntax to use.

    The examples I have found seem to suggest that before I use the WebBrowser class it is required to assign it to a URL. Following that< can set the visitiblity to hidden. But wouldn't it be too late then?

    The "Navagate" method does not seem to offer the capacity to load a URL hidden.


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice