import re

'''
取值postid,左边界"postid=",右边界"&"
'''
url="http://wwww.baidu.com/aspx?postid=6232&actiontip='保存成功'"
postid=re.findall(r"postid=(.*?)&",url)[0]
print(postid)
def findall_data(data,LB="",RB=""):
rule=LB + r"(.+?)" + RB
datalist=re.findall(rule,data)
return datalist
data1=findall_data(url,"postid=",'&')[0]
print(data1)

  

python re.findall(rule,data),根据左右边界取值url中参数的值的更多相关文章

  1. [Python爬虫] 之十一:Selenium +phantomjs抓取活动行中会议活动信息

    一.介绍 本例子用Selenium +phantomjs爬取活动行(http://www.huodongxing.com/search?qs=数字&city=全国&pi=1)的资讯信息 ...

  2. [Python爬虫] 之十:Selenium +phantomjs抓取活动行中会议活动

    一.介绍 本例子用Selenium +phantomjs爬取活动树(http://www.huodongshu.com/html/find_search.html?search_keyword=数字) ...

  3. [Python爬虫] 之九:Selenium +phantomjs抓取活动行中会议活动(单线程抓取)

    思路是这样的,给一系列关键字:互联网电视:智能电视:数字:影音:家庭娱乐:节目:视听:版权:数据等.在活动行网站搜索页(http://www.huodongxing.com/search?city=% ...

  4. 【Python】如何取到input中的value值?

    练习:取到下方链接下所有海贼王的下载链接. # coding=utf-8 from selenium import webdriver from time import sleep import ke ...

  5. Python Web-第二周-正则表达式(Using Python to Access Web Data)

    0.课程地址与说明 1.课程地址:https://www.coursera.org/learn/python-network-data/home/welcome 2.课程全名:Using Python ...

  6. 【Python学习笔记】Coursera课程《Using Python to Access Web Data 》 密歇根大学 Charles Severance——Week2 Regular Expressions课堂笔记

    Coursera课程<Using Python to Access Web Data > 密歇根大学 Charles Severance Week2 Regular Expressions ...

  7. 《Using Python to Access Web Data》 Week5 Web Services and XML 课堂笔记

    Coursera课程<Using Python to Access Web Data> 密歇根大学 Week5 Web Services and XML 13.1 Data on the ...

  8. 《Using Python to Access Web Data》Week4 Programs that Surf the Web 课堂笔记

    Coursera课程<Using Python to Access Web Data> 密歇根大学 Week4 Programs that Surf the Web 12.3 Unicod ...

  9. Python Tutorial 学习(五)--Data Structures

    5. Data Structures 这一章来说说Python的数据结构 5.1. More on Lists 之前的文字里面简单的介绍了一些基本的东西,其中就涉及到了list的一点点的使用.当然,它 ...

随机推荐

  1. [CSP-S模拟测试]:u(差分)

    题目背景 $\frac{1}{4}$遇到了一道水题,完全不会做,于是去请教小$D$.小$D$看了一眼就切掉了这题,嘲讽了$\frac{1}{4}$一番就离开了.于是,$\frac{1}{4}$只好来问 ...

  2. python类与对象练习题扑克牌

    #定义一个扑克类,属性是颜色,数字.#定义一个手类,属性是扑克牌得颜色数字#定义一个人类,属性是左手,右手.类里定义一些方法,比如交换,展示 class Poker : def __init__(se ...

  3. Ubuntu紫色背景颜色代码

    前言 我一直很中意Ubuntu的紫,记录一下颜色代码以免忘了! so Ubuntu紫色背景颜色代码background=300924 red = 48 green 9 blue  36

  4. 阿里云二级域名解析指向服务器另一台主机— —Nginx

    这是在一台阿里云服务器没有任何域名,但是配置高,因此想借用另一台阿里云服务器(配置较低)已备案的域名 跳转到这台配置高的服务器,那么使用nginx反向代理 server { listen 80; se ...

  5. Reciting(third)

      It is subtly demonstrate in the portrayal that a teacher is teaching mathmatics in a certain class ...

  6. PAT甲级【2019年3月考题】——A1156 SexyPrimes【20】

    Sexy primes are pairs of primes of the form (p, p+6), so-named since “sex” is the Latin word for “si ...

  7. 关于linux的一些常用的指令

    top:命令经常用来监控linux的系统状况,比如cpu.内存的使用. free:观察内存使用. Find:查找指定的文件. Whereis:查找指定的文件源和二进制文件和手册等 Which:用于查询 ...

  8. 洛谷 P1197 [JSOI2008]星球大战——并查集

    先上一波题目 https://www.luogu.org/problem/P1197 很明显删除的操作并不好处理 那么我们可以考虑把删边变成加边 只需要一波时间倒流就可以解决拉 储存删边顺序倒过来加边 ...

  9. SpringBoot-SpringCloud-版本对应关系

    刚开始研究SpringCloud和SpringBoot的时候,困惑点比较多,SpringBoot是从1.X.X到目前的2.X.X版本,但是SpringCloud基于SpringBoot,版本之间肯定是 ...

  10. 49.求1+2+3+.......+n

    题目描述:   求1+2+3+...+n的值,要求不能使用乘除法,还有,if,while,for等关键字. 思路分析:   使用递归的解法,但是递归的终止条件需要使用if关键字不符合要求,所以我们利用 ...