如何使用 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 --page-requisites --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.