def parseHome(self,response):
if len(response.body) > 50:
print "###########################"
print "Fetch Home Success"
print "###########################"
infos = json.loads(response.body)
if infos.get('cards', ''):
cards = infos['cards']
for card in cards:
if card['card_type'] == 6:
print '========================================='
#????ID??????
ori_ID = re.findall(r'\d+',card['actionlog']['oid'])[0]
ori_url = 'https://m.weibo.cn/api/container/getIndex?containerid={ori_id}_-_WEIBO_SECOND_PROFILE_WEIBO_ORI&type=uid&page_type=03&value={value}'.format(
ori_id = ori_ID,value=response.meta['ID']
)
print 'ori_ID:',ori_ID
yield Request(url=ori_url, meta={'ID': response.meta["ID"],'ori_id': ori_ID, 'owner':response.meta['owner']},
callback=self.parseTweets, dont_filter=True)
评论列表
文章目录