urlopen方法返回一个html
对html使用info()方法返回HTTPMessage对象实例
import urllibdef print_list(lists): ???for i in lists: ???????print(i)html = urllib.urlopen("http://www.runoob.com/python/python-email.html")#info()方法返回HTTPMessage实例msg = html.info()#HTTPMessage实例的方法:#headers#gettype()#getheader()/getheaders()#items()/keys()/values()print_list(msg.headers)
urllib使用二
原文地址:https://www.cnblogs.com/chillytao-suiyuan/p/9147655.html