此为记录下我自己的爬虫学习过程。
利用url包抓取网页
import urllib.request #url包
def main():
url = "https://www.douban.com/"
response = urllib.request.urlopen(url) #请求
html = response.read() #获取
html = html.decode("utf-8") #解码
print(html) #打印
if __name__ == "__main__":
main()
import urll