- 博客(2)
- 收藏
- 关注
原创 使用RE爬取豆瓣TOP250实战
result = obj.finditer(page)#使用迭代器finditer从网页元代码page中进行搜索满足obj正则表达式的内容。csvwriter.writerow(dic.values())#将封装好的内容写入csv文件。print(i.group('year').strip()) # strip()去除空格。dic['year']=dic['year'].strip()#对year进行去除空格处理。print(i.group('name'))#输出特定内容。
2025-07-13 17:27:12
274
原创 python爬虫-百度翻译1022错误 求解决方法
resp = requests.post(url,data=dat)#申请post请求。s = input("请输入翻译的英文单词: ")#print(resp.test)#x显示字节。
2025-07-11 15:08:24
797
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅