爬虫
https://github.com/bda-research/node-crawler
https://scrapy.org/ https://github.com/scrapy/scrapy
由于有数据请求URL,直接通过URL请求JSON数据,然后解析数据并保存。
pip install -r requirements.txt
采集:
cd python-request
python getDataFromGov.py
采集完成后,out目录下的log日志文件中找到报错的页码。如果没有报错,直接执行下面的清理数据脚本。
补充数据的时候,把页码填写到:
def get_all_lost_page():
pages = [288, 289, 290, 1037] # 遗漏的页码
fetch_all_lost_page(pages)
然后修改main函数执行这个函数。
清理数据:
cd python-request
python clean_data.py