弹幕接口可以通过b站 转换到手机端获取
弹幕接口:https://comment.bilibili.com/108577248.xml
利用正则表达式提取弹幕
import requests
import re
url = "https://comment.bilibili.com/108577248.xml"
r = requests.get(url)
# print(r.content.decode("utf-8"))
# ret = re.findall(r'<d(.*?)/d>',r.content.decode("utf-8"))
#' p="385.97600,1,25,16777215,1565097766,0,3fa6c8ee,19899661036290052">弹幕呢?<'
ret = re.findall(r'<d\sp=.*?>(.*?)</d>',r.content.decode("utf-8"))
print(ret)
网友评论