Fetching webpages as IE/Firefox
-
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,
-
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,
-
We have tried that, it still complains about the user agent :(
-
We have tried that, it still complains about the user agent :(
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
-
We have tried that, it still complains about the user agent :(
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 youThanks and Regards Sandeep