解决pyecharts运行后产生的html文件用浏览器打开空白或者jupyter无法显示

您所在的位置:网站首页 googlemap打开空白 解决pyecharts运行后产生的html文件用浏览器打开空白或者jupyter无法显示

解决pyecharts运行后产生的html文件用浏览器打开空白或者jupyter无法显示

2024-02-01 12:32| 来源: 网络整理| 查看: 265

Python爬取B站历史观看记录并用Bokeh做数据可视化

m0_74000379: history里有一个叫bvid的,实际上就是BV号,'https://www.bilibili.com/video/'+BV号就是视频链接,我自己只用到了视频链接,所以我的代码是这样的。[code=python] with open('video_list.txt', 'w', encoding='utf-8') as file: while cur_list: for video_info in cur_list: print(video_info) history = video_info.get('history') if history: # print(history) BV = history['bvid'] if BV: file.write('https://www.bilibili.com/video/' + BV + '\n') cursor = response.json()['data']['cursor'] url = 'https://api.bilibili.com/x/web-interface/history/cursor?max={}&view_at={}&business=archive'.format( cursor['max'], cursor['view_at']) response = session.get(url, cookies=cookies_dict) cur_list = response.json()['data']['list'] [/code]



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3