简体   繁体   中英

HttpWebRequest and HttpWebResponse

I am trying to get the Response string by using C#'s WebRequest and WebResponse classes.

It pulls the string but some part such as forms are missing from response.But when I open the same URL in browser(manually) and inspect elements using firebug it shows every thing.

What may be the problem that I am not getting complete response from WebResponse...???

There are several reasons possible (Javascript, IFRAMEs etc.), for example:

IF the site is using AJAX/JavaScript to build those forms dynamically on the client THEN what you see is correct... Background: since WebRequest does not execute Javascript the result "HttpWebRequest" versus Browser is different...

Because WebRequest does not run Javascript code inserted into website. You would have to evaluate javascript by yourself. Duplicate: C# httpwebrequest and javascript

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM