import urllib.request
#urlopen()向URL发请求,返回响应对象
response=urllib.request.urlopen('http://www.baidu.com')
#提取响应内容
html=response.read().decode('utf-8')
#打印响应内容
print(html)
#导入模块
import urllib.request
#向网站发送get请求
response=urllib.request.urlopen('http://httpbin.org/get')
html = response.read().decode()
print(html)
from urllib import request
# 定义变量:URL 与 headers
url = 'http://httpbin.org/get<