TaoBao Crawler
星期一, 20. 十一月 2017 07:10下午
做图像处理和做物体识别检测的很多朋友都会有这样一个感受。没有数据集!!!!博主一直苦于没有数据集。而作为最大的,最集中的图片库–淘宝网(百度出来的图片的离散度太高)却无法使用简单的爬虫方式获取图片。(妹子图的爬虫+cook处理也没有用。。。)为此,博主使用了selenium仿真爬虫,这种爬虫的兼容性比较高,只是速度一般,5000张图片需要大约30min,如果爬一夜的话,估计就够我们用的了。源码在github仓库里。也可使用
git clone git@github.com:lucky-ing/TaoBaoCrawler.git
下载到本地。
2017-10-20更新!突破&终结淘宝全线封锁!
依赖项
firefox browser
python 3.0+
selenium
BeautifulSoup
tqdm
Tutorial
#this program uses firefox browser, we should have firefox browser in computer first.\n
#if we just use the base function of this program
#-s specific the key word of searching.you can input any word you want to scraper. this parameter is requested!
python3 main.py -s 电脑
#-f specific the path where Image storage location
python3 main.py -s 电脑 -f ./image
#-n specific the max num of the downloads
python3 main.py -s 电脑 -n 5000
about the selenium
selenium is a Automated testing tool, it can run browser automatly. Taobao have anti-reptile strategy that if we use this tool, taobao website will send the context.