Fetch the repository succeeded.
import requests # 导入模块
# 获取地址
url = "https://api.bilibili.com/x/web-interface/wbi/search/type?__refresh__=true&_extra=&context=&page=2&page_size=42" \
"&from_source=&from_spmid=333.337&platform=pc&highlight=1&single_column=0&keyword=newbing&qv_id" \
"=EPR9ZzQSvQUFzrgBXoRKRqzSOJCqwQae&ad_resource=5654&source_tag=3&category_id=&search_type=video&dynamic_offset" \
"=30&w_rid=617b36a3365518e0063ecb8a56e3f54a&wts=1678004658 "
# 发送请求并接收
req = requests.get(url)
data = req.json()['data']['result']
print(data)
for info in data:
author = info['author'] # 筛选数据
arcurl = info['arcurl']
typename = info['typename']
# 保存数据
with open("B站.csv", "a+") as f:
f.write('{},{},{}\n'.format(author, arcurl, typename))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。