- 博客(2)
- 收藏
- 关注
原创 红楼梦出现次数为前20的人物名称(含人物列表)
import jiebatxt=open("D:\红楼梦.txt","r",encoding='utf-8').read()words=jieba.lcut(txt)counts={}names=open("D:\人名.txt","r",encoding='utf-8').read()for word in words: if len(word)==1: continue elif word == '贾母' or word == '老太太': ...
2021-10-27 11:19:16
3346
原创 pathon爬虫
1.爬虫原理(1)url_list(2)发送请求,获取响应(3)解析响应:①提取url(翻页/详情),然后放入list中继续循环前面步骤②提取数据,保存数据2.发送请求①发送请求;importrequestsurl=‘地址’②模拟浏览器;请求头header={user-agent…(浏览器信息)}r=requests.get(url,headers=header).json()#Response[200]响应的状态码~200代表请求成功,print(“r”)③获取数据(注意获.
2021-10-24 16:46:55
136
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人