1
我有網站我需要保存大量的網頁。頁面按增量順序排列,index.php?id = 1,index.php?id = 2 ....是否有shell腳本(使用mac)我可以運行循環遍歷所有這些頁面並將它們單獨保存到一個目錄?使用命令行保存大量的HTML文件
我有網站我需要保存大量的網頁。頁面按增量順序排列,index.php?id = 1,index.php?id = 2 ....是否有shell腳本(使用mac)我可以運行循環遍歷所有這些頁面並將它們單獨保存到一個目錄?使用命令行保存大量的HTML文件
#!/bin/bash
url='http://example.com/index.php?='
dir='path/to/dir'
filename=file
extension=ext
for i in {1..100}
do
wget "$url$i" -O "$dir$filename$i.$ext"
done
在bash:
for i in {1..100}; do wget http://www.example.com/index.php?id=${i}; done