邮箱
import requests
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36'
}
url = 'https://movie.douban.com/subject/10430826/discussion/44288625/'
response = requests.get(url,headers=headers)
html = response.text
print(html)
import re
str_ = html
regex = re.compile("[a-z0-9\.\-+_]+@[a-z0-9\.\-+_]+\.[a-z]+")
res = regex.findall(str_)
for r in res:
print (r)
with open("D:/10999.txt","wb") as f:
for i in res:
test2 = i.encode('UTF-8')
f.write(test2+b'\n')
f.close