2017年2月26日

[\S\s]+ 可以匹配多行html,最常用的还是.*?

摘要: [\S\s]+ 可以匹配多行html,最常用的还是.*? 阅读全文

posted @ 2017-02-26 20:41 andrewleeeeee 阅读(89) 评论(0) 推荐(0) 编辑

正则,分组,字符集,使用场景

摘要: 保证匹配的唯一性,如果匹配不到多加条件分组(),匹配内容需要分离出来用,都要用分组,如下图,换行和span中间的内容,由于分组的缘故被放在了同一个元组中,如此重复抓取 字符集,13[3,5,8] 这种情况使用 阅读全文

posted @ 2017-02-26 20:39 andrewleeeeee 阅读(112) 评论(0) 推荐(0) 编辑

正则在重复抓取的情况下一定要分组

摘要: 正则在重复抓取的情况下一定要分组 阅读全文

posted @ 2017-02-26 16:46 andrewleeeeee 阅读(242) 评论(0) 推荐(0) 编辑

Python 出现 can't use a string pattern on a bytes-like object

摘要: # coding=utf-8 import urllib.request import re url = 'http://www.163.com' file = 'd:/test.html' data = urllib.request.urlopen(url).read() r1 = re.comp 阅读全文

posted @ 2017-02-26 16:07 andrewleeeeee 阅读(9565) 评论(0) 推荐(0) 编辑

导航