摘要: CrawlSpider继承Spider,提供了强大的爬取规则(Rule)供使用 <! more 填充 ,浏览器中的请求头 sql SET FOREIGN_KEY_CHECKS=0; Table structure for lagou_job DROP TABLE IF EXISTS ; CREATE 阅读全文
posted @ 2018-11-04 19:39 寒菱 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 首先搭建虚拟环境,创建工程 <! more 修改 获取网页信息 ArticleSpider/spiders/jobbole.py ArticleSpider/items.py ArticleSpider/pipelines.py ArticleSpider/settings.py 创建一个文件夹 , 阅读全文
posted @ 2018-11-04 19:37 寒菱 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 登陆 参考 "https://github.com/zkqiang/Zhihu Login" <! more 数据库设计 sql DROP TABLE IF EXISTS ; CREATE TABLE ( bigint(20) NOT NULL, varchar(255) DEFAULT NULL, 阅读全文
posted @ 2018-11-04 19:35 寒菱 阅读(615) 评论(0) 推荐(0) 编辑
摘要: 随机切换UserAgent "https://github.com/hellysmile/fake useragent" scrapy 使用 fake useragent <! more 在全局配置文件中禁用掉默认的UA,将其设置为None即可 settings.py 在中间件中编写自己的middl 阅读全文
posted @ 2018-11-04 19:32 寒菱 阅读(206) 评论(0) 推荐(0) 编辑