urllib使用二
2024-09-05 06:09:55
urlopen方法返回一个html
对html使用info()方法返回HTTPMessage对象实例
import urllib def 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)
最新文章
- ViewController respondsToSelector 错误的解决方法
- HBase 实战(2)--时间序列检索和面检索的应用场景实战
- php大力力 [048节] php一点支付开发资料,很散
- WaxPatch中demo注意问题
- core animation (转)
- MVC学习中遇到问题
- Maven构建项目速度慢问题解决
- using inno setup uninstall default icon
- Android应用源码安卓短信拦截木马项目源码
- vijos 1085 Sunnypig闯三角关
- UVA 11729 - Commando War(贪心 相邻交换法)
- VS2015预览版中的C#6.0 新功能(一)
- 实测Eclipse连接小米2S调试问题
- HoloLens开发手记 - 构建2D应用 Building 2D apps
- js表白心形特效
- 压缩感知“Hello World”代码初步学习
- spring整合redis使用RedisTemplate的坑Could not get a resource from the pool
- react-router路由地址变了页面却没有跳转的解决办法
- SQL0803问题 键值重复
- nrf52832-定时器例程