爬虫
urllib
protocol://hostname[:port]/path/[;parameters][?query]#fragment
URL由三部分组成
1)协议2)存放资源的服务器的域名系统或IP地址
3)主机资源的具体地址
import urllib.request
response =urllib.request.urlopen("https://ilovefishc.com")
html = reponse.read()
print(html)
geturl() 返回请求的url
info()返回一个httplib.HTTPMessage 对象,包含远程服务器返回的头信息
getcode() 返回http状态码