采集中文小说网站的爬虫
novelSpider的Python项目详细描述
Python境
- python 2.7版
- MySQL 5.7.9
项目名称
pip install novelSpider
MySQL数据库
# 加入 mysqld.cnf
# * Encode
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
项目名称
fromnovelSpider.taskimportTaskclassConfig(object):'''
@desc:数据库配置
@param:username 数据库用户名
@param:password 数据库密码
'''def__init__(self):self.username='root'self.password='root'self.database='novel'# 创建任务实例task=Task()# 创建爬虫实例spider=task.createDownloader(Config)# 下载小说书目信息、章节列表spider.getCharptList(novelNum=1)# 下载小说书目信息、章节列表spider.getCharptContent(novelId=0,charptNum=1)
版
0.0.13版
# 支持下载小说书目信息、章节列表、章节内容
# 支持下载小说书目信息、章节列表、章节内容