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)
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)