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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • moris7@hotmail.com

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

    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 :



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

    I have tried with HttpWebRequest, WebRequest,
    AllowAutoRedire ct=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

  • billsahiker@yahoo.com

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

    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.

    On Mar 18, 2:57 pm, mor...@hotmail. com wrote:
    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?...ortfolio&login...
    >
    and download the source page in a txt file that i could save on my
    computer.
    >
    I have tried with HttpWebRequest, WebRequest,
    AllowAutoRedire ct=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

    Comment

    Working...