2018年8月17日

喜马拉雅-春秋

摘要: import requests from lxml import etree from urllib import parse url = 'https://www.ximalaya.com/lishi/4164479/' headers = { 'user-agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.3... 阅读全文

posted @ 2018-08-17 16:41 Pyton当歌人生几何 阅读(82) 评论(0) 推荐(0) 编辑

正则 {} | 【】

摘要: import re # line = 'ahhuuhhaaahhhhang123' #line = 'ahuuuhuuu' # 需要获取h和h之间,需要包含特定数量字符的子串 # 使用 + h和h之间至少要有一个字符 # {} 限定它前面出现的那个东西的出现次数 # match_res = re.search('h.{3,6}h', line) # if match_res: # ... 阅读全文

posted @ 2018-08-17 00:05 Pyton当歌人生几何 阅读(554) 评论(0) 推荐(0) 编辑

导航