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 ...
随机推荐
- VS2008中编译运行MFC应用程序时,出现无法启动程序,因为计算机中丢失mfc90ud.dll的解决方案
解决方法:"工具"->"选项"->"项目和解决方案"->"VC++目录",在可执行文件栏中加上如 ...
- SQL中to_char方法的应用
1.取得当前日期是本月的第几周 SQL> select to_char(sysdate,'YYYYMMDD W HH24:MI:SS') from dual; ----------------- ...
- 关于软件IntelliJ IDEA的使用技巧(二)
二,IntelliJ IDEA的工具栏介绍 2,IntelliJ IDEA菜单栏 (5)code编码 ✌1.Override Methods:覆盖方法 ✌2.Implement Methods:实现方 ...
- Redis哨兵机制(sentinel)
1.简介: 1.是什么: Redis-Sentinel是Redis官方推荐的高可用(HA)方案,当用Reids 做master-slave高可用方案时,假如master宕机了,redis本身(包括它的 ...
- KiCAD绘制器件内部逻辑符号库
KiCAD绘制器件内部逻辑符号库 像比较器,运放这些器件,里面是由多个相同的part组成,有时候我们只需要用到其中一个或者某几个,又或者是为了在原理图中更清楚的表达出逻辑关系,需要单独绘制内部的逻辑符 ...
- HDU-5215 Cycle 无向图判奇环偶环
题意:给一个无向图,判断这个图是否存在奇环和偶环. 解法:网上有一种只用dfs就能做的解法,但是我不太理解. 这里用的是比较复杂的.首先奇环很简单可以用二分图染色判断.问题是偶环怎么判断?这里我们想, ...
- idea 右键没有class文件的问题,,
修改文件夹的 属性 蓝色即为java代码,,绿色为test,,等等
- leetcode-161周赛-5248-统计【优美子数组】
题目描述: 自己的提交:超时: class Solution: def numberOfSubarrays(self, nums, k: int) -> int: dp = [0]* (len( ...
- Delphi获取指定文件的版本号
获取指定文件的版本号 方式一: function GetFileVersion(FileName: string): string; type PVerInfo = ^TVS_FIXEDFILEINF ...
- php时间时间戳
/* *+ ------------------------------- * 计算当天起始点和结束点时间戳 取出当天的数据 *+ ------------------------------ */ ...