我想一键下载整个网站的所有html,css和js文件.我尝试右键单击并查看源代码,但后来我必须复制粘贴每个页面并自己创建文件夹,因此它非常繁琐.是否有任何开源软件可以帮助我做到这一点,还是我必须自己编写代码?
wget 是你的朋友在这里,它适用于Windows,Mac和Linux.
wget -r -np -k http://yourtarget.com/even/path/down/if/you/need/it/
-r is recursive
-np (do not follow links to parent directories)
-k to make links in downloaded HTML or CSS point to local files
Run Code Online (Sandbox Code Playgroud)
其他有用的选择:
-nd (no directories): download all files to the current directory
-e robots.off: ignore robots.txt files, do not download robots.txt files
-A png,jpg: accept only files with the extensions png or jpg
-m (mirror): -r --timestamping --level inf --no-remove-listing
Run Code Online (Sandbox Code Playgroud)