给敖

root 站长 2021-07-24 21:50:54 2021-07-24 21:51:02 0
#_*_ 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)
{{ vote && vote.total.up }}