import urllib.request
def download(url):
print("DOWNLOADING:",url)
try:
html=urllib.request.urlopen(url).read()
print(html)
except Exception as e:
print("DOWNLOAD ERROR:",e)
html=None
return html
download("http://www.ccb.com/")
上面的代码输出如下:
DOWNLOADING: http://www.ccb.com/
b'<SCRIPT LANGUAGE="JavaScript">\n window.location="/cn/home/indexv3.html";\n</SCRIPT>\n\n\n'
请问,这个 html 的输出从网页的源码中是找不到的,为何 html 输出后会是这样的内容?谢谢!