Skip to content

Commit e17845c

Browse files
author
dqw
committed
key参数匹配
1 parent 1f6b4c9 commit e17845c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎utils/spider.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@ def get_html(url, args, flag_get_new_link):
4949
new_link = get_link(html)
5050
else:
5151
# 下载匹配关键字的页面
52-
if not self.encoding:
52+
if not args.encoding:
5353
charset = chardet.detect(html)
54-
self.encoding = charset['encoding']
54+
args.encoding = charset['encoding']
5555

56-
match = re.search(re.compile(self.key), html.decode(self.encoding, "ignore"))
56+
match = re.search(re.compile(args.key), html.decode(args.encoding, "ignore"))
5757
if match and flag_get_new_link:
58+
print 'match'
5859
new_link = get_link(html)
5960
else:
6061
print 'not match'

0 commit comments

Comments
 (0)