How do I save a web page, programmatically?

前端 未结 3 1025
予麋鹿
予麋鹿 2021-01-05 08:48

I would like to save a web page programmatically.

I don\'t mean merely save the HTML. I would also like automatically to store all associated files (images, CSS file

3条回答
  •  -上瘾入骨i
    2021-01-05 08:58

    Take a look at wget, specifically the -p flag

    −p  −−page−requisites
    This option causes Wget to download all the files
    that are necessary to properly display
    a givenHTML  page. Thisincludes such
    things as inlined images, sounds, and
    referenced stylesheets.
    

    The following command:

    wget -p http:///1.html
    

    Will download page.html and all files it requires.

提交回复
热议问题