HttpWebRequest only returning NOFRAMES part of page

T

Toralf

Greetings

I have trouble catching the actual HTML Source code of a
HttpWebRequest when the result of a successful login is a Frameset (I
cant seem to get hold of the Frameset page Source code).

The request is an automated basic login post (HttpWebRequest.Method =
"POST" with username and password) which successfully catches Cookies
etc. But the sources code I get is the NOFRAMES part of the frameset
page:

"The page requires a frames-capable browser. Almost every modern
browser includes frame support, so you may wish to try upgrading to a
browser such as Netscape or Internet Explorer."

The underlaying pages are accessible withour the frameset but that
isnt the point. I need to get hold of the actual Frameset code all
well. I have gone through all HttpWebRequest and HttpWebResponse
properties but so far I couldnt find a solution to this little
kickup.

Anyone managed to do this?
 
B

bruce barker

the site is probably looking at user agent to determine if the browser
supports frames. send a user agent header like IE's, to trick the site.

-- bruce (sqlwork.com)
 
K

Ken Dopierala Jr.

Hi,

This sounded interesting so I gave it a try. To get it working I had to set
my UserAgent to this:

objRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;
..NET CLR 1.0.3705; .NET CLR 1.1.4322)"

I tested on this page:

http://msdn.microsoft.com/library/default.asp

Worked good, returned the Frameset to me. I think then to get what you want
you'd have to parse it for the value of the src of each frame, then make a
request on those pages. Good luck! Ken.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top