# -*- coding: utf-8 -*-
"""
Created on Mon May 07 11:05:49 2018
B站爬虫:
功能: 1 获取评论人数,点赞数,用户个人信息及评论等等
@author: Alis
"""
import re,time
import requests
import os
import json
headers = {'user-agents':'User-Agent:Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1'}
def getavID(pn):
avID = []
for i in range(1,pn+1):
url = 'https://api.bilibili.com/x/web-interface/dynamic/region?&jsonp=jsonp&pn=%d&ps=50&rid=24&_=1525679623909'%i
r = requests.get(url,headers = headers).text
data = json.loads(r)
archives = data['data']['archives']
for ac in archives:
avID.append(ac['aid'])
print 'aid: ',ac['aid']
print 'title: ',ac['title']
print 'attrib
bilibili网站爬虫
最新推荐文章于 2024-07-15 11:23:54 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)