#/usr/bin/bash
wget http://pygtk.org/pygtk2tutorial/examples/
ARRAY=($(cat index.html | awk '{print $5}' | grep href | sed -r 's/.*"(.+)".*/\1/' | sed '1,2d'))
for i in ${ARRAY[*]}
do
wget http://pygtk.org/pygtk2tutorial/examples/${i}
done
wget http://pygtk.org/pygtk2tutorial/examples/
ARRAY=($(cat index.html | awk '{print $5}' | grep href | sed -r 's/.*"(.+)".*/\1/' | sed '1,2d'))
for i in ${ARRAY[*]}
do
wget http://pygtk.org/pygtk2tutorial/examples/${i}
done
今天快下班了,用wget一个一个下载pygtk 官方的例子,好累啊。想着是不是写一个脚本替代下我的双手,简单分析发现,果然可以。
然后就写了上面的脚本,可以一键下载所有例子,太给力了