和大家分享一个shell脚本写的图片抓取器.使用方法:img_downloader.sh.使用时在shell下输入:./img_downloader.sh www.baidu.com -d images该shell脚本就会把百度首页上的图片下载下来.代码: #!/bin/bash if [ $# -ne 3 ]; then echo "Usage: $0 URL -d DIRECTORY" exit -1 fi for i in {1..4} do case $1 in -d) shi
#!python3 #multidownloadXkcd.py - Download XKCD comics using multiple threads. import requests import bs4 import os import threading # os.mkdir('xkcd', exist_ok=True) # store comics in ./xkcd if os.path.exists('xkcd'): print("xkcd is existed!")