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(.*?)

最新文章

  1. ElasticSearch 5学习(9)——映射和分析(string类型废弃)
  2. 第三个Sprint冲刺第八天
  3. CentOS RHEL 安装 Tomcat 7
  4. des加密解密的两个方法
  5. [git]git 分支
  6. Java-基础练习2
  7. [百科] - SIP(会话发起协议)
  8. 转:对TCP/IP网络协议的深入浅出归纳
  9. linux 命令(1)screen
  10. POJ 2153 Rank List (map映射)
  11. 由12306出错想到的div垂直居中的问题
  12. CF# 260 A. Laptops
  13. csdn肿么了,这两天写的博文都是待审核
  14. C#高级编程学习一-----------------第五章泛型
  15. [51nod1684]子集价值
  16. 我是如何沉迷于linux系统的?
  17. centos7 部署 docker ce
  18. 【PMP】组织级项目管理(OPM)和战略
  19. v-show v-if 的使用
  20. darknet中的若干问题

热门文章

  1. keepalive+Haproxy
  2. Zabbix当内存剩余不足10%的时候触发报警
  3. 《代码大全2》读书笔记 Week8
  4. LeetCode Array Easy 122. Best Time to Buy and Sell Stock II
  5. python字典拼接方法
  6. MySQL 复制参数详解
  7. Codeforces 19E&BZOJ 4424 Fairy(好题)
  8. node.js提供的服务器live-server的使用
  9. express 使用art-template模板引擎
  10. windows更改文件打开方式