随笔分类 -  python爬虫之scrapy框架

摘要:1、settings.py主要配置信息,包括USER_AGENT等 # -*- coding: utf-8 -*- # Scrapy settings for renren project # # For simplicity, this file contains only settings co 阅读全文
posted @ 2019-07-01 10:33 小白啊小白,Fighting 阅读(554) 评论(0) 推荐(0) 编辑
摘要:1、创建工程 2、创建项目 3、安装pymysql 4、settings.py文件,主要是全局字段的定义,包括数据库信息 # -*- coding: utf-8 -*- # Scrapy settings for jd project # # For simplicity, this file co 阅读全文
posted @ 2019-06-28 15:19 小白啊小白,Fighting 阅读(456) 评论(0) 推荐(0) 编辑
摘要:1、创建工程 2、创建项目 3、既然保存到数据库,自然要安装pymsql 4、settings文件,配置信息,包括数据库等 # -*- coding: utf-8 -*- # Scrapy settings for tencent project # # For simplicity, this f 阅读全文
posted @ 2019-06-28 12:48 小白啊小白,Fighting 阅读(5193) 评论(0) 推荐(1) 编辑
摘要:1、settings.py文件 # -*- coding: utf-8 -*- # Scrapy settings for jd project # # For simplicity, this file contains only settings considered important or 阅读全文
posted @ 2019-06-28 09:57 小白啊小白,Fighting 阅读(521) 评论(0) 推荐(0) 编辑
摘要:针对这种招聘信息,使用crawlscrapy很适合。 1、settings.py # -*- coding: utf-8 -*- # Scrapy settings for gosuncn project # # For simplicity, this file contains only set 阅读全文
posted @ 2019-06-27 16:39 小白啊小白,Fighting 阅读(359) 评论(0) 推荐(0) 编辑
摘要:1、redis的使用,自己可以多学习下,个人也是在学习 2、下载安装scrapy-redis 3、下载好了,就可以使用了,使用也很简单,只需要在settings.py配置文件添加一下四个 如:settings.py # -*- coding: utf-8 -*- # Scrapy settings 阅读全文
posted @ 2019-06-27 10:10 小白啊小白,Fighting 阅读(1383) 评论(0) 推荐(0) 编辑
摘要:1、参考博客 阅读全文
posted @ 2019-06-26 15:06 小白啊小白,Fighting 阅读(284) 评论(0) 推荐(0) 编辑
摘要:1、FormRequest表单实现自动登陆 2、FormRequest.from_response模拟自动登陆 3、笔记 a)FormRequest b) FormRequest.from_response 阅读全文
posted @ 2019-06-26 13:08 小白啊小白,Fighting 阅读(3168) 评论(0) 推荐(0) 编辑
摘要:知识点 1、学习官网网址 2、settings文件,USER_AGENTS代理池 3、middleware.py处理代码池 4、参考学习 a)代理UserAgent b) 代理ip 阅读全文
posted @ 2019-06-26 11:34 小白啊小白,Fighting 阅读(640) 评论(0) 推荐(0) 编辑
摘要:知识点 1、创建工程 2、创建工程 3、setting.py文件设置COOKIES和COOKIES_DEBUG # -*- coding: utf-8 -*- # Scrapy settings for qq project # # For simplicity, this file contain 阅读全文
posted @ 2019-06-26 11:03 小白啊小白,Fighting 阅读(2885) 评论(0) 推荐(0) 编辑
摘要:注意点: 1、创建工程 2、创建项目 3、settings文件添加日志级别,USER_AGENT # -*- coding: utf-8 -*- # Scrapy settings for zjh project # # For simplicity, this file contains only 阅读全文
posted @ 2019-06-26 10:07 小白啊小白,Fighting 阅读(2672) 评论(0) 推荐(0) 编辑
摘要:1、debug了解 2、scrapy shell了解 3、settings.py # -*- coding: utf-8 -*- # Scrapy settings for gosuncn project # # For simplicity, this file contains only set 阅读全文
posted @ 2019-06-25 11:13 小白啊小白,Fighting 阅读(482) 评论(0) 推荐(0) 编辑
摘要:1、定义爬取的字段items.py # -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # https://doc.scrapy.org/en/latest 阅读全文
posted @ 2019-06-25 10:55 小白啊小白,Fighting 阅读(343) 评论(0) 推荐(0) 编辑
摘要:1、创建工程 2、创建项目 3、运行项目 4、gaoxinxing.py代码 # -*- coding: utf-8 -*- import scrapy import logging logger = logging.getLogger(__name__) #引入日志 class Gaoxinxin 阅读全文
posted @ 2019-06-24 22:59 小白啊小白,Fighting 阅读(235) 评论(0) 推荐(0) 编辑
摘要:1、知识点 2、scrapy项目中使用logging 2、普通项目中 a)建立一个通用的log_a.py b)log_b.py文件使用通用的log_a.py 阅读全文
posted @ 2019-06-24 21:30 小白啊小白,Fighting 阅读(2043) 评论(0) 推荐(0) 编辑
摘要:1、知识点 2、spider.py文件中通过 2、修改pipelines.py文件,对其中的item可以操作 # -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline 阅读全文
posted @ 2019-06-24 21:06 小白啊小白,Fighting 阅读(2213) 评论(0) 推荐(0) 编辑
摘要:1、知识点 2、目录结构 3、解析案例 阅读全文
posted @ 2019-06-22 23:29 小白啊小白,Fighting 阅读(1195) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示