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. 运维 03 Linux之文档与目录结构

    Linux之文档与目录结构   Linux文件系统结构 Linux目录结构的组织形式和Windows有很大的不同.首先Linux没有“盘(C盘.D盘.E盘)”的概念.已经建立文件系统的硬盘分区被挂载到 ...

  2. layer通过父页面调用子页面的方法及属性

    引言 在使用layer.js的过程中,需要通过layer.open()以iframe的形式打开特定的页面,同时需要用layer的按钮对打开的页面进行提交及重置操作,但是苦于不知如何在父页面调用子页面的 ...

  3. Oracle查看有锁进程,删除锁

    查看锁表进程SQL语句1: select sess.sid,     sess.serial#,     lo.oracle_username,     lo.os_user_name,     ao ...

  4. 忘记root密码

    Ubuntu密码恢复的方法如下: 1.重新启动,按ESC键进入Boot Menu,选择recovery mode(一般是第二个选项).2.在#号提示符下用cat /etc/shadow,看看用户名.3 ...

  5. arcpy-字段唯一值、重复值、最值、平均值、方差、标准差、中数、众数

    插个广告,制作ArcGIS的Tool工具学习下面的教程就对了: 零基础学习Python制作ArcGIS自定义工具观看链接 <零基础学习Python制作ArcGIS自定义工具>课程简介 im ...

  6. koa2实现登录注册功能(ejs+mongodb版)

    gtihub仓库地址:(由于国内处于敏感时期,github暂时无法访问) 主要使用的中间件: "ejs": "^2.7.1",(渲染模板) "koa& ...

  7. Ubuntu下串口工具

    一.Kermit 1.安装: sudo apt-get install ckermit 2.配置: sudo gedit /etc/kermit/kermrc 3.在文件末端添加如下内容 : set ...

  8. webapp兼容问题解决

    1. IOS移动端click事件300ms的延迟响应 移动设备上的web网页是有300ms延迟的,玩玩会造成按钮点击延迟甚至是点击失效.这是由于区分单击事件和双击屏幕缩放的历史原因造成的, 2007年 ...

  9. WPF ListBox 横向排列

    WPF ListBox 横向排列   如果只是单纯的让ListBox可以横向配列,这样很简单,只需要更改ListBox的ItemsPanel模板就可以,例如: <ListBox><L ...

  10. linux IPC socket(2)

    使用bind来关联地址和套接字 #include <sys/types.h> #include <sys/socket.h> int bind(int sockfd, cons ...