码迷,mamicode.com
首页 > Web开发 > 详细

获取网页源代码

时间:2017-07-23 21:10:19      阅读:229      评论:0      收藏:0      [点我收藏+]

标签:span   网页   request   http   com   ons   utf-8   urlopen   log   

import urllib.request
response = urllib.request.urlopen("http://www.fishc.com")
html = response.read()
html = html.decode("utf-8")
print(html)

 

获取网页源代码

标签:span   网页   request   http   com   ons   utf-8   urlopen   log   

原文地址:http://www.cnblogs.com/zhoujingguoguo/p/7225786.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!