a = 尾页数#由上面的代码得到while i<=int(a):
content = urllib.urlopen(url+str(i)).read()
print("现在在下载第"+str(i)+"页,总共"+str(a) +"页")
i += 1
pattern = r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}'
items =re.findall(pattern,content)
for item in items:
print item
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
注意事项:如果按照上面输出的是乱码可以这么写
print("现在在下载第".decode("utf-8").encode("gb2312")+str(i)+"页,总共".decode("utf-8").encode("gb2312")+str(get_ye(url)) +"页".decode("utf-8").encode("gb2312"))
i += 1