Skip to content

Commit 8c6aa10

Browse files
JINGJING
authored andcommitted
处理多作者情况
1 parent 5b070cc commit 8c6aa10

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

comic-index.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
regex7 = re.compile(r"<li><a\stitle=\"[^\"]+\"\shref=\"([^\"]+)\"\s*>(.+)</a></li>")
2525
#过滤最新章回
2626
regex8 = re.compile(r"g_last_update\s=\s\"([^\"]+)\"")
27+
#多作者情况过滤
28+
regex9 = re.compile(r"(<[^\>]+>)")
2729

28-
url_test = "http://manhua.dmzj.com/meishidefulu/"
30+
url_test = "http://manhua.dmzj.com/miaogongzhu/"
2931

3032
socket = urllib2.urlopen(url_test)
3133
content = socket.read()
@@ -47,6 +49,9 @@
4749
for x in update:
4850
chapters.append((x[0], x[1]))
4951

52+
for x in regex9.findall(author):
53+
author = author.replace(x, "")
54+
5055
with open("output.txt", "w") as f:
5156
f.write("封面 - " + cover + "\n")
5257
f.write("漫画名 - " + name + "\n")

0 commit comments

Comments
 (0)