#!/usr/bin/python #-*- coding:utf-8 -*- import requests import re def get_email(url): """get all the email address from the url""" content = requests.get(url).text pattern = r'[0-9a-zA-Z._]+@[0-9a-zA-Z._]+.[0-9a-zA-Z._]+' p = re.compile(pattern) m = p.findall(content) with open('emil.txt', 'a') as f: for mm in m: f.write(mm+' ') ''''' with open('tmp.html', 'w') as f: f.writelines(content) ''' if __name__=='__main__': get_email('https://www.aliyun.com/jiaocheng/442063.html')