From 560914f9452650b944101e2ce7820d6270f6621c Mon Sep 17 00:00:00 2001 From: xoyabc <1031138448@qq.com> Date: Wed, 23 Oct 2019 02:22:43 +0800 Subject: [PATCH] Update demo.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改正则匹配样式,去除评论中的 '' --- "python \347\210\254\350\231\253/douban/demo.py" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/python \347\210\254\350\231\253/douban/demo.py" "b/python \347\210\254\350\231\253/douban/demo.py" index a861713..bed0801 100644 --- "a/python \347\210\254\350\231\253/douban/demo.py" +++ "b/python \347\210\254\350\231\253/douban/demo.py" @@ -30,7 +30,7 @@ def get_one(num): # 解析网页结构 def parse_page(html): info = [] - patten1 = re.compile(r'
.*?(.*?).*?.*?.*?

(.*?)

.*?
', re.S) + patten1 = re.compile(r'
.*?(.*?).*?.*?.*?

.*?(.*?).*?

.*?
', re.S) datas = re.findall(patten1, html) for data in datas: comic = {}