上一页 1 2 3 4 5 6 7 ··· 14 下一页
摘要: Redis .redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)、zset(sorted set --有序集合)和hash(哈希类型)。这些数据类型都支持push/pop、add/re 阅读全文
posted @ 2017-11-01 17:14 昂达达 阅读(624) 评论(0) 推荐(0) 编辑
摘要: piplines 5个 方法 import json import os import requests class JsonPipeline(object): def __init__(self): self.file = open('xiaohua.txt', 'w') def process_ 阅读全文
posted @ 2017-10-31 16:41 昂达达 阅读(387) 评论(0) 推荐(1) 编辑
摘要: 经过一周+2天的努力,终于有点成果了,感觉好爽啊 http://123.184.17.251:8080/index.html 阅读全文
posted @ 2017-10-31 15:36 昂达达 阅读(150) 评论(2) 推荐(0) 编辑
摘要: Scrapy是一个为了爬取网站数据,提取结构性数据而编写的应用框架。 其可以应用在数据挖掘,信息处理或存储历史数据等一系列的程序中。其最初是为了页面抓取 (更确切来说, 网络抓取 )所设计的, 也可以应用在获取API所返回的数据(例如 Amazon Associates Web Services ) 阅读全文
posted @ 2017-10-23 10:40 昂达达 阅读(287) 评论(2) 推荐(0) 编辑
摘要: 2. 高性能相关 基本原理: IO多路复用:select,用于检测socket对象是否发生变化(是否连接成功,是否有数据到来) Socket:socket客户端 import socket import select class Request(object): def __init__(self, 阅读全文
posted @ 2017-10-23 10:25 昂达达 阅读(297) 评论(10) 推荐(0) 编辑
摘要: 初步操作: scrapy startproject hello (创建hello项目) scrapy genspider chouti dig.chouti.com 创建一个spider scrapy crawl chouti运行spider 指定运行chouti这个项目 import scrapy 阅读全文
posted @ 2017-10-18 16:34 昂达达 阅读(149) 评论(1) 推荐(0) 编辑
摘要: 定义: 网络爬虫(又被称为网页蜘蛛,网络机器人,在FOAF社区中间,更经常的称为网页追逐者),是一种按照一定的规则,自动地抓取万维网信息的程序或者脚本。另外一些不常使用的名字还有蚂蚁、自动索引、模拟程序或者蠕虫。 ******************************************* 阅读全文
posted @ 2017-10-16 14:18 昂达达 阅读(241) 评论(3) 推荐(0) 编辑
摘要: li=[ {'user':'la','id':1}, {'user':'la','id':2}, {'user':'la','id':13}, {'user':'la','id':4}]dic={}for line in li: dic[line['id']]=line# print(dic)pri 阅读全文
posted @ 2017-09-28 14:25 昂达达 阅读(339) 评论(3) 推荐(0) 编辑
摘要: class RegisterForm(Form): # user_id=fields.IntegerField() username=fields.CharField( max_length=12, min_length=4, required=True, error_messages={'requ 阅读全文
posted @ 2017-09-28 11:42 昂达达 阅读(1022) 评论(0) 推荐(0) 编辑
摘要: 请求过来: 中间件:拦截一部分请求;比如验证session, 没有登录的 请求一些页面,跳转至登录页;(图片为中间件的请求过程.) 再到 urls ,分发请求 到views 视图 ,通过 CBV(dispatch反射) 和 FBV 的 get 请求 讲 template 页面渲染返回给用户; 渲染之 阅读全文
posted @ 2017-09-28 10:12 昂达达 阅读(1185) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 14 下一页