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的更多相关文章

  1. [note]What I’ve learnt from working on startups

    What I've learnt from working on startups 从失败里学到了什么,六次创业失败. 企业家不是与生俱来的,也是靠学来的. 想的太多,做的太少.

  2. Today I learnt

    2015-May-22 In Oracle database, dropping a table don't free up the space directly. You'll need to di ...

  3. 学习笔记之三十年软件开发之路 - 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 ...

  4. 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 ...

  5. 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. ...

  6. 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 ...

  7. Usual tiny skills & solutions

    Ubuntu and Win10 - double OS 2016-02-21 Yesterday I helped my friend install Ubuntu (14.04 LTS) on h ...

  8. Sensitive directory/file Integrity Monitoring and Checking

    catalogue . OSSEC . HashSentry: Host-Based IDS in Python . Afick . 检测流程 1. OSSEC OSSEC is an Open So ...

  9. HDU4787 GRE Words Revenge(AC自动机 分块 合并)

    题目 Source http://acm.hdu.edu.cn/showproblem.php?pid=4787 Description Now Coach Pang is preparing for ...

随机推荐

  1. Vue环境搭建及第一个helloWorld

    Vue环境搭建及第一个helloWorld 一.环境搭建 1.node.js环境安装配置  https://www.cnblogs.com/liuqiyun/p/8133904.html 或者 htt ...

  2. for in 的实现

    v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VM ...

  3. 浅析Draw Call

    Draw Call是CPU对GPU的一种命令,仅仅指向一个需要被渲染的图元列表,在OpenGL和DirectX中分别体现为glDrawElements和DrawIndexedPrimitive图像编程 ...

  4. leetcode.矩阵.240搜索二维矩阵II-Java

    1. 具体题目 编写一个高效的算法来搜索 m x n 矩阵 matrix 中的一个目标值 target.该矩阵具有以下特性:每行的元素从左到右升序排列:每列的元素从上到下升序排列. 示例: 现有矩阵 ...

  5. Spring 使用@Async出现循环依赖Bean报错的解决方案

    初现端倪 Caused by:org.springframework.beans.factory.BeanCurrentlyInCreationException: Errorcreating bea ...

  6. 怎么在vue-cli中利用 :class去做一个底层背景或者文字的点击切换

    // html <div class="pusherLists" :class="{hidden: isHidden}"> <span @cl ...

  7. SmartSql简介

    0. Why 拥抱 跨平台 DotNet Core,是时候了. 高性能.高生产力,史上最轻量级的ORM.107kb 1. So SmartSql TargetFrameworks: .NETFrame ...

  8. android studio安装中出现Failed to install Intel HAXM错误的解决方法

    1.问题分析 从下面可以知道安装Intel HAXM失败,请检查haxm_silent_run.log这篇日志. (1)先了解一下什么是Intel HAXM Intel代表的是英特尔,HAXM的全程是 ...

  9. shell变量的间接引用

  10. WiFi基础知识

    自从只需少量的话费就可以将笔记本.平板电脑连接到互联网,WiFi已成为我们熟知的网络,并无处不在.Wi-Fi对于一些物联网应用十分有用,比如楼宇自动化.内部能源管理.WiFi的重要性对于我们的日常生活 ...