Update WeiboUserSpider.py
适配新的ID
This commit is contained in:
parent
62fa085ec7
commit
45110c22d3
@ -61,8 +61,11 @@ class WeiboSpider(scrapy.Spider):
|
|||||||
if account_rsp['code'] == 200:
|
if account_rsp['code'] == 200:
|
||||||
all_user_info = account_rsp['content']
|
all_user_info = account_rsp['content']
|
||||||
for user_info in all_user_info:
|
for user_info in all_user_info:
|
||||||
yield scrapy.Request('https://m.weibo.cn/api/container/getIndex?containerid=%s' % user_info['userUid'],
|
uid = user_info['userUid']
|
||||||
callback=self.parse, meta={'currentCount': 0, 'uid': user_info['userUid']})
|
if uid[:6] != '107603':
|
||||||
|
uid = f'107603{uid}'
|
||||||
|
yield scrapy.Request('https://m.weibo.cn/api/container/getIndex?containerid=%s' % uid,
|
||||||
|
callback=self.parse, meta={'currentCount': 0, 'uid': uid})
|
||||||
|
|
||||||
def parse(self, response):
|
def parse(self, response):
|
||||||
rsp = json.loads(response.text)
|
rsp = json.loads(response.text)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user