一周搞定scrapy之3,将爬取到的起点中文网信息保存到mysql

安装mysql

去mysql官网下载
https://dev.mysql.com/downloads/installer/
在这里插入图片描述
在这里插入图片描述
(除了这步要改一下,其余的都是默认继续)然后安装路径默认
在这里插入图片描述
设置密码,最后完成

该之前的代码

(以下是github全部源码)
https://github.com/junasir/qidianhot/tree/master

第一步
改pipelines.py文件在这里插入图片描述
第二步
改settings.py文件
在这里插入图片描述
最后我们新建一个py文件,文件名字是start.py

from scrapy import  cmdline

#执行小说热销榜的命令
cmdline.execute("scrapy crawl hot".split())



猜你喜欢

转载自blog.csdn.net/weixin_44868057/article/details/107086110