Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Fetching webpages as IE/Firefox

Fetching webpages as IE/Firefox

Scheduled Pinned Locked Moved C#
comhelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    phimix
    wrote on last edited by
    #1

    Aloha, We are creating a windows app. that will read some information from a website. Our problem is that the target website doesn't like our requests, it complains that our app. is an undefined HTTP_USER_AGENT. We can access the website with IE and Firefox, so now we are looking for a way to make our windows app. look like one of these browsers when it requests a webpage. Any idea how we can do that? Thanks,

    phi Geek Load - Free Geek Stuff for Everybody :omg:

    A 1 Reply Last reply
    0
    • P phimix

      Aloha, We are creating a windows app. that will read some information from a website. Our problem is that the target website doesn't like our requests, it complains that our app. is an undefined HTTP_USER_AGENT. We can access the website with IE and Firefox, so now we are looking for a way to make our windows app. look like one of these browsers when it requests a webpage. Any idea how we can do that? Thanks,

      phi Geek Load - Free Geek Stuff for Everybody :omg:

      A Offline
      A Offline
      aSarafian
      wrote on last edited by
      #2

      Try looking up the WebBrowser Control which comes with .Net2

      P 1 Reply Last reply
      0
      • A aSarafian

        Try looking up the WebBrowser Control which comes with .Net2

        P Offline
        P Offline
        phimix
        wrote on last edited by
        #3

        We have tried that, it still complains about the user agent :(

        phi Geek Load - Free Geek Stuff for Everybody :omg:

        S 2 Replies Last reply
        0
        • P phimix

          We have tried that, it still complains about the user agent :(

          phi Geek Load - Free Geek Stuff for Everybody :omg:

          S Offline
          S Offline
          Sandeep Akhare
          wrote on last edited by
          #4

          Can you try this public void functionToNavigate() { object oMissing = null; HTMLDocumentClass objects=new HTMLDocumentClass(); axWebBrowser1.Navigate(URL,ref oMissing,ref oMissing,ref oMissing,ref oMissing); while(axWebBrowser1.Busy) { Application.DoEvents(); } objects=(HTMLDocumentClass)axWebBrowser1.Document; } private void axWebBrowser1_Enter(object sender, System.EventArgs e) { } Why you are getting this error any idea ?

          Thanks and Regards Sandeep

          1 Reply Last reply
          0
          • P phimix

            We have tried that, it still complains about the user agent :(

            phi Geek Load - Free Geek Stuff for Everybody :omg:

            S Offline
            S Offline
            Sandeep Akhare
            wrote on last edited by
            #5

            Hi i have develop one application in which i need to read data from Web page which is written by javascript function i alter my solution by different logic but i got the parameters which are passed to the javascript funciton read whole by reaading whole respnonse in the stream reader HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(webPageObject.Url); WebProxy myProxy = new WebProxy("10.4.10.66", 80); myHttpWebRequest.Proxy = myProxy; Uri siteUri = new Uri(webPageObject.Url); c = new Cookie("chasezip",_wholeZipCode, "/", ".chase.com"); c2 = new Cookie("marketlist",webPageObject.MarketList, "/", ".chase.com"); myHttpWebRequest.CookieContainer = new CookieContainer(); CookieCollection cookiesBefore= myHttpWebRequest.CookieContainer.GetCookies(siteUri); myHttpWebRequest.CookieContainer.Add(siteUri, c); myHttpWebRequest.CookieContainer.Add(siteUri, c2); CookieCollection cookiesAfter= myHttpWebRequest.CookieContainer.GetCookies(siteUri); response = (HttpWebResponse)myHttpWebRequest.GetResponse(); resStream = response.GetResponseStream(); _streamReader = new StreamReader(resStream); Hope i am on right track to understand you

            Thanks and Regards Sandeep

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups