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 ...
随机推荐
- 力扣算法——136SingleNumber【E】
Given a non-empty array of integers, every element appears twice except for one. Find that single on ...
- FrameWork内核解析之WindowManagerService(一)中篇
阿里P7Android高级架构进阶视频免费学习请点击:https://space.bilibili.com/474380680 1.WMS概述 WMS是系统的其他服务,无论对于应用开发还是Framew ...
- P4363 [九省联考2018]一双木棋
题面 这种搜索要把后继状态都跑出来之后取Min/Max 也就是回溯的时候进行操作 记得用hash进行记忆化(用map不开O2会TLE) #include<iostream> #includ ...
- 线性方程组迭代算法——Jacobi迭代算法的python实现
原理: 请看本人博客:线性方程组的迭代求解算法——原理 代码: import numpy as np max=100#迭代次数上限 Delta=0.01 m=2#阶数:矩阵为2阶 n=3#维数:3X3 ...
- C#5.0 异步编程 Async和Await--介绍
C#5.0引入async和await关键字实现方法的异步调用. 直接进入正题. async只是一个标识符,并没有实际的用途,只是用于表明某个方法是异步方法,在方法前面加上async 表示该方法为一个异 ...
- Java工程师面试linux操作选择面试题大全
1.请写出常用的linux指令不低于10个,请写出linux tomcat启动.linux指令arch 显示机器的处理器架构(1)uname -m 显示机器的处理器架构(2)shutdown -h n ...
- java反射技术主要实现类有哪些,作用分别是什么
Java反射技术主要实现类有哪些,作用分别是什么? 在JDK中,主要由以下类来实现Java反射机制,这些类都位于java.lang.reflect包中 1)Class类:代表一个类 2)Field 类 ...
- position: absolute 如果不设置left, right, top, bottom会在什么位置
一般我们设置position: absolute都会一起设置left/right/top/bottom, 但是如果不设置, 布局会是什么样子的呢? 直接上图 1.一个大盒子中4个小盒子, 正常文档流布 ...
- 基于.Net4.0实现 ToastNotification
基于.Net4.0实现 ToastNotification Windows更新之路的特色之一就是消息提示由气泡变成了通知窗口,效果简直不要太好.最近公司有这方面的需求,需要在xp,win7系统上给出提 ...
- 使用 @Log4j2 log.error() 打印异常日志
public static void main(String[] args) { int a = 10; try { int i = 1/0; } catch (Exception e) { Syst ...