第一个爬虫
import requests # 获取页面 url="https://blog.csdn.net/qq_40733911" # 抓数据 re=requests.get(url) # 解码 con=re.content.decode() # print(type(con)) # 写入文件 with open('01.html','w',encoding='utf-8') as file: file.write(con)2018/6/12
import requests # 获取页面 url="https://blog.csdn.net/qq_40733911" # 抓数据 re=requests.get(url) # 解码 con=re.content.decode() # print(type(con)) # 写入文件 with open('01.html','w',encoding='utf-8') as file: file.write(con)2018/6/12