python 3.5 urllib

python 3.5 里面urllib模块不能用了,需要改成urllib.request

#coding=utf-8

import urllib.request

def getHtml(url):
	page = urllib.request.urlopen(url)
	html = page.read()
	return html

html = getHtml("http://tjcredit.gov.cn/gsxt/")

print (html)
    原文作者:dangyang1992
    原文地址: https://blog.csdn.net/dangyang1992/article/details/53435016
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞