- 博客(14)
- 收藏
- 关注
转载 MongoDB、PyMongo数据操作
MongoDB 命令C:\Program Files\MongoDB\Server\4.0\binmongo客户端mongod服务端mongoexport导出普通格式,每条记录一行,整个文件不是合法的json语法:mongoexport -d <数据库> -c <集合> --out <输出的文件>...
2019-01-15 14:24:00
161
转载 scrapy Mongodb 储存
pipelines.py# -*- coding: utf-8 -*-# Define your item pipelines here## Don't forget to add your pipeline to the ITEM_PIPELINES setting# See: https://doc.scrapy.org/en/latest/topics/...
2019-01-11 17:58:00
184
转载 scrapy 爬取小说
QiushuSpider# -*- coding: utf-8 -*-import scrapyimport timefrom qiushu.items import QiushuItemclass QiushuspiderSpider(scrapy.Spider): name = 'QiushuSpider' allowed_domain...
2019-01-11 17:49:00
246
转载 scrapy 爬取前程无忧
spider# -*- coding: utf-8 -*-import scrapyfrom Jobs.items import JobsItemclass Job51spiderSpider(scrapy.Spider): name = 'Job51Spider' allowed_domains = ['www.51job.com', 'se...
2019-01-11 17:45:00
240
转载 scrapy 爬取智联招聘
准备工作 1. scrapy startproject Jobs 2. cd Jobs 3. scrapy genspider ZhaopinSpider www.zhaopin.com 4. scrapy crawl ZhaopinSpider 5. pip install diskcache 6. pip install tinydb 7. scrapy cr...
2019-01-11 17:42:00
218
转载 scrapy 爬取斗罗大陆漫画
# -*- coding: utf-8 -*-import scrapyimport jsonimport osimport urllibimport timefrom scrapy.http import Requestfrom selenium import webdriverfrom selenium.webdriver.common.by ...
2019-01-11 17:30:00
471
转载 Python MD5算法使用
## md5算法简介1. **简介** MD5消息摘要算法(MD5 Message-Digest Algorithm),一种被广泛使用的密码散列函数,可以产生出一个128位(16字节)的散列值(hash value),用于确保信息传输完整一致。MD5由美国密码学家罗纳德·李维斯特(Ronald Linn Rivest)设计,于1992年公开,用以取代MD4算法。...
2018-11-19 11:31:00
273
转载 python 正则表达式
一、 正则表达式元字符\ddigit,数字(等效:[0-9])\d+匹配连续的数字\D非数字\D{3}匹配连续的非数字\wword,单词([A-Z0-9a-z_])\w{6}6个单词字符...
2018-11-19 11:25:00
181
转载 Python并发解决方案
一、subprocess模块call():执行命令,返回程序返回码(int)import subprocessprint(subprocess.call("mspaint"))check_output():执行命令,返回输出(bytes)import subprocessimport chardetoutput = subprocess...
2018-11-19 11:18:00
204
转载 python 常用标准库
标准库和第三方库第一手资料:在线: 官方文档(https://docs.python.org/)离线:交互式解释器(dir()、help()函数),IPython(tab键提示、?、??)一、 日期和时间(https://docs.python.org/3/library/datetime.html) datetime模块 da...
2018-11-19 10:45:00
290
转载 python 包和模块
一、 模块 使用内置函数vars()可以查看当前环境下有哪些对象(变量、函数、类) from 模块 import *: 不会导入以下划线开头的对象 只会导入__all__中定义了的对象(__all__中的每个元素需要是str类型) from pprint import PrettyPrinter ...
2018-11-19 10:30:00
129
转载 Git常用命令
1. 克隆代码:- 语法:`git clone <仓库地址>`- 示例:`git clone https://github.com/geeeeeeeeek/git-recipes.git`2. 查看状态- 语法:`git status`3. 查看文件修改- 语法:`git diff <file>`- 示例:`git diff README.md`4. ...
2018-11-16 08:41:00
120
转载 python 装饰器
装饰器缺陷:自定义装饰器,缺失了一些功能(比如:函数的__name__属性不正确);而使用Python标准库提供的系统提供的装饰器辅助定义函数就可以很好地解决这个问题:from functools import wraps装饰器(函数)定义要点l 返回值是一个函数l 返回的函数的内部,调用将来要被装饰的函数l 推荐使用...
2018-07-30 15:39:00
151
转载 Python 异常处理
一、 异常概念Python在执行代码之前,会进行语法检查,如果语法出错了,会抛出语法错误(SyntaxError)。Python程序运行期间检测到的错误被称为异常。内置异常:BaseException:所有异常的基类错误类异常(发生之后,如果不捕获,将会导致程序终止): SystemExit:解释器请求退出 KeyboardInte...
2018-07-27 17:51:00
153
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅