wget download aspx page

10,087

Courtesy of the wget manual page (first result of a web search on "wget options", btw):

wget -E http://whatever.url.example.com/x/y/z/foo.aspx

If you also wish to download all related media (CSS, images, etc.), use -p, possibly with --convert-links (rewrites the page for offline viewing):

wget -Ep --convert-links http://whatever.url.example.com/x/y/z/foo.aspx
Share:
10,087
Tracy
Author by

Tracy

Those who wish to succeed must ask the right preliminary questions You could email me: [email protected]

Updated on June 04, 2022

Comments

  • Tracy
    Tracy almost 2 years

    I want to download the web page http://www.codeproject.com/KB/tips/ModelViewController.aspx using wget, so I simply used the really basic command:

    wget http://www.codeproject.com/KB/tips/ModelViewController.aspx

    What I received was a file with the .aspx extension, which could not be displayed correctly in a regular browser.

    How can I download that web page?

  • Piskvor left the building
    Piskvor left the building almost 13 years
    That is incorrect, wget can do that quite easily (-p --convert-links, this functionality has been there for years). Note also that wget can do the renaming for you (-E). See the manual: gnu.org/software/wget/manual/wget.html#Advanced-Usage
  • Tracy
    Tracy almost 13 years
    i tried your answer,it seems that wget just downloads the page and appends the suffix in html,still could not display the downloaded "html" page correctly,although better than doing nothing,specifically,code highlighting and several pictures are lost.
  • Tracy
    Tracy almost 13 years
    @Haz, i did that renaming thing,but like i said in the comment on @Piskvor 's answer,code highlighting and several pictures are lost,and the terrible font.
  • Tracy
    Tracy almost 13 years
    @Piskvor,by using the option -p and --convert-links(equivalent to -k),all i get is a folder containing files related to the page downloaded,however,there is still an aspx extension file which has the same problem,i could not find an nice normal html page after digging down the folder.
  • Piskvor left the building
    Piskvor left the building almost 13 years
    @Tracy: Well, have you tried, y'know, combining the switches? -E -p --convert-links (and btw, there's more good stuff in that manual)
  • Piskvor left the building
    Piskvor left the building almost 13 years
    @Tracy: You didn't mention that you also wanted to download the associated images and other data.
  • Tracy
    Tracy almost 13 years
    @Piskvor, seems i missed the -E option,sorry for that and i am really appreciate your help !