📜  python下载html作为字符串 - Html代码示例

📅  最后修改于: 2022-03-11 14:52:50.996000             🧑  作者: Mango

代码示例1
# open-webpage.py

import urllib.request, urllib.error, urllib.parse

url = 'http://www.oldbaileyonline.org/browse.jsp?id=t17800628-33&div=t17800628-33'

response = urllib.request.urlopen(url)
webContent = response.read()

print(webContent[0:300])