#_*_ encoding = utf-8 _*_
import re
import requests
def save(list):
with open('demo.txt', 'w', newline='', errors='ignore') as f:
for i in list:
f.write(i)
f.write('\n')
url = 'https://api.bilibili.com/x/v1/dm/list.so?oid=246648707'
requests = requests.get(url)
requests.encoding = 'utf-8'
requests = requests.text
p = re.compile('<d.*?>(.*?)</d>')
data = p.findall(requests)
save(data)