Urllib基础

import urllib.request
urllib.request.urlretrieve("http://www.baidu.com", "E:\\python_spider\\tmp\\test.html")
urllib.request.urlcleanup()

file=urllib.request.urlopen("https://read.douban.com/provider/all")
print(file.info())
print(file.getcode())
print(file.geturl())

你可能感兴趣的:(Urllib基础)