Download web page from URL (with redirect) to a text file with vb.net

  • Thread starter Thread starter moris7
  • Start date Start date
M

moris7

Hi everyone,

i tried a lot but i don't seem to be able to do anything conclusive !

Here what i want to do :

LogIn in a webpage using this URL :

http://movies.hsx.com/servlet/Login...mand=login&username=extreme2006&password=1242

and download the source page in a txt file that i could save on my
computer.

I have tried with HttpWebRequest, WebRequest,
AllowAutoRedirect=true...etc....

nothing works...all that it downloads is a source page where it says
Please LogIn...but where i use this URL in a browser...it shows me the
correct page and i can save manually the source code of the page.

Can someone attemp to crack this problem ?

I don't need anything fancy...only something that i can put a URL and
a save file path...thats it.

Thank you very much...!

I've put so many hours on this....

Martin
 
When I clicked on the link you provided I got the login page. My guess
is that you have a cookie on your computer from the last time you
entered a username and password and that is why you do not get the
login screen when you use your browser. You can use the WebBrowser
control to accomplish what you want, but it is a bit cumbersome. It
allows you to post the username and password in code so the webbrowser
will automatically go to the next page.
I have used it to login to Yahoo and retrieve my mail without having
to type in anything.
The html source is loaded into a document object which you can then
save to a file. Read up on the Webbrowser Control at msdn. You should
also find some good articles on its use if you search Google.
 
Back
Top