WebCrawler網(wǎng)站數(shù)據(jù)采集工具
WebCrawler 是一個(gè)網(wǎng)站數(shù)據(jù)采集工具,使用 scrapy 框架。
環(huán)境準(zhǔn)備
- [Scrapy] (http://scrapy.org/)
- [MongoDB] (https://www.mongodb.org/)
已實(shí)現(xiàn)的功能
- 爬取網(wǎng)站發(fā)貼信息(標(biāo)題、標(biāo)題URL、作者、作者URL等),以及下載圖片到本地
- 爬取用戶地理位置信息
- 增加 RandomUserAgent 功能,防止被 BAN
- 增加延時(shí)抓取功能,防止被 BAN
- 采用hash方法分散到多個(gè)目錄進(jìn)行管理,提高打開文件夾速度
快速開始
#: 安裝必要 python 庫 sudo pip install scrapy sudo pip install pymongo #: 下載數(shù)據(jù)到本地,并且保存相關(guān)信息到MongoDB中. scrapy crawl collector #: 建立本地http server,查看爬取數(shù)據(jù) python -m SimpleHTTPServer 80 #: 打開瀏覽器輸入http://localhost/data
評論
圖片
表情
