How to download all files (but not HTML) from a website using wget?

前端 未结 8 996
生来不讨喜
生来不讨喜 2020-11-29 14:19

How to use wget and get all the files from website?

I need all files except the webpage files like HTML, PHP, ASP etc.

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 15:06

    To filter for specific file extensions:

    wget -A pdf,jpg -m -p -E -k -K -np http://site/path/
    

    Or, if you prefer long option names:

    wget --accept pdf,jpg --mirror --page-requisites --adjust-extension --convert-links --backup-converted --no-parent http://site/path/
    

    This will mirror the site, but the files without jpg or pdf extension will be automatically removed.

提交回复
热议问题