import requestsimport re#弹幕获取url = httpsapibilibilicomxv1dmlistsooid=1225961348response = requestsgeturlresponseencoding = utf-8# printresponsetextdanmu_list = refindalld p=dresponsetextprintdanmu_lis
这段代码采用了requests库发送GET请求来获取网页内容,使用正则表达式re模块来提取所需的弹幕信息。
原文地址: http://www.cveoy.top/t/topic/iZkx 著作权归作者所有。请勿转载和采集!