what have we learnt in day five
what is file?
virtual unit offered by operation system
steps to open file
1.find the file_path(file_path)
2.open file(open)
3.read or change the file(read/write)
4.save the files(flush)
5.close the file (close)
three modes to open .txt file
w:clear the file and write in
r:can only read
a:write in after the file
two ways to open .txt file
b:binary
t:text
you'd better not to use three ways below
1.r+
2.a+
3.w+
with in charge of the context
f=open()
f.read()
#close file automaticly
with open() as f
f.read()
principle of crawler
send requests through explore to get files,through requests module analog browser gets content
process of crawler
1.send requests(filling url)
2.get context
3.choose the value you need
use of requests module
import requests
res=requests.get(url)
#wenben
res.txt
#erjinzhiliu
res.content
re module
re.S search all
re.findall() choose what you need in the context
if you need anything just(.*?)
what have we learnt in day five的更多相关文章
- [note]What I’ve learnt from working on startups
What I've learnt from working on startups 从失败里学到了什么,六次创业失败. 企业家不是与生俱来的,也是靠学来的. 想的太多,做的太少.
- Today I learnt
2015-May-22 In Oracle database, dropping a table don't free up the space directly. You'll need to di ...
- 学习笔记之三十年软件开发之路 - Things I Learnt The Hard Way (in 30 Years of Software Development)
三十年软件开发之路 https://mp.weixin.qq.com/s/EgN-9bIHonRid1DM0csQDw https://blog.juliobiason.net/thoughts/th ...
- Lesson 17 Always young
Text My aunt Jennifer is an actress. She must be at least thirty-five years old. In spit of this, sh ...
- Lesson 14 Do you speak English?
Text I had an amusing experience last year. After I had left a small village in the south of France. ...
- How do servlets work-Instantiation, sessions, shared variables and multithreading[reproduced]
When the servletcontainer (like Apache Tomcat) starts up, it will deploy and load all webapplication ...
- Usual tiny skills & solutions
Ubuntu and Win10 - double OS 2016-02-21 Yesterday I helped my friend install Ubuntu (14.04 LTS) on h ...
- Sensitive directory/file Integrity Monitoring and Checking
catalogue . OSSEC . HashSentry: Host-Based IDS in Python . Afick . 检测流程 1. OSSEC OSSEC is an Open So ...
- HDU4787 GRE Words Revenge(AC自动机 分块 合并)
题目 Source http://acm.hdu.edu.cn/showproblem.php?pid=4787 Description Now Coach Pang is preparing for ...
随机推荐
- Notepad++中直接运行python
点击进入幕布视图浏览 https://mubu.com/doc/a8VGCUfqqw 一.使用Notepad++编辑python文件,并直接运行 1.用notepad++打开python文件.或者新建 ...
- springCloud的使用01-----服务的注册和发现
1 搭建eureka注册服务器 1.1 创建springboot项目,导入相应的jar包依赖 <project xmlns="http://maven.apache.org/POM/4 ...
- 微信小程序app.json文件常用全局配置
小程序根目录下的 app.json 文件用来对微信小程序进行全局配置,决定页面文件的路径.窗口表现.设置网络超时时间.设置多 tab 等. JOSN文件不允许注释,下面为了学习加上注释,粘贴需要的片段 ...
- 用户界面样式(cursor,resize,vertical-align,outline,文字超出显示省略号)
1. 鼠标样式 cursor default: 小白(箭头)默认 pointer:小手 move:移动 text:文本 not-allowed:禁止 2. 轮廓线(表单外发光)outline 给表单添 ...
- redis - 环境搭建(转)
一:简介(来自百科) redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合)和zse ...
- SQL LIKE 运算符
SQL LIKE 运算符 在WHERE子句中使用LIKE运算符来搜索列中的指定模式. SQL LIKE 操作符 LIKE 操作符用于在 WHERE 子句中搜索列中的指定模式. 有两个通配符与LIKE运 ...
- YII 中加入短信接口的函数
public function smsto($telphone,$message) { //短信接口用户名 $uid,如果没有或不能发送请与客服联系 $uid = 'zyd'; //短信接口密码 $p ...
- tomcat源码分析一之getCanonicalFile和getAbsolutePath的区别
最近在看tomcat源码 1.getPath(): 返回定义时的路径,(就是你写什么路径,他就返回什么路径) 2.getAbsolutePath(): 返回绝对路径,但不会处理“.”和“..”的情况 ...
- 数据结构学习笔记——顺序数组1
线性表最简单的刚开始就是顺序存储结构,我是看着郝斌的视频一点一点来的,严蔚敏的书只有算法,没有具体实现,此笔记是具体的实现 为什么数据结构有ADT呢,就是为了满足数据结构的泛性,可以在多种数据类型使用 ...
- (转)阿里RocketMQ Quick Start
转:http://blog.csdn.net/a19881029/article/details/34446629 RocketMQ单机支持1万以上的持久化队列,前提是足够的内存.硬盘空间,过期数据数 ...