如何使用wget从网站下载所有文件(但不是HTML)?

问题描述:

如何使用 wget 并从网站获取所有文件?

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

我需要除网页之外的所有文件文件如HTML,PHP,ASP等。

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

要过滤特定的文件扩展名:

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 --progress --adjust-extension --convert-links --backup-converted --no-parent http://site/path/

这将镜像网站,但没有 jpg pdf 扩展名将被自动删除。

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