python3抓取qq号

import re
import urllib.request

mylist=urllib.request.urlopen("http://bbs.tianya.cn/post-140-393974-1.shtml")
qqre=re.compile("[1-9]\d{4,10}",re.IGNORECASE)
for line in mylist:
line=line.decode("utf-8")
if line.find("QQ")!=-1 or line.find("Qq")!=-1 or line.find("qq")!=-1:
mylist=qqre.findall(line)
print(mylist)

posted on 2017-11-07 23:38  888ewe  阅读(680)  评论(0)    收藏  举报

导航