parent
056910d742
commit
55aa59dc37
@ -0,0 +1,23 @@
|
||||
import requests
|
||||
import openpyxl
|
||||
|
||||
url='https://api.bilibili.com/x/v1/dm/list.so?oid=1083801012'
|
||||
|
||||
headers={
|
||||
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36'
|
||||
}
|
||||
|
||||
response=requests.get(url=url,headers=headers)
|
||||
|
||||
response.encoding='utf-8'
|
||||
|
||||
# print(response.text)
|
||||
|
||||
import re
|
||||
|
||||
content_list=re.findall('<d p=".*?">(.*?)</d>',response.text)
|
||||
|
||||
for content in content_list:
|
||||
with open('弹幕.txt',mode='a',encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
f.write('\n')
|
Loading…
Reference in new issue