def atuser_uid_parser(self, response): item = WeibospiderItem() analyzer = Analyzer() friendcircle = FriendCircle() total_pq = analyzer.get_html(response.body,'script:contains("W_face_radius")') uid = friendcircle.get_user_uid(total_pq) self.atuser_dict[response.meta['atuser_nickname']] = uid item['atuser_uid'] = uid item['uid'] = response.meta['uid'] item['atuser_nickname'] = response.meta['atuser_nickname'] yield item
def parse_load(self,response): item = WeibospiderItem() analyzer = Analyzer() friendcircle = FriendCircle() total_pq = analyzer.get_mainhtml(response.body) item['uid'] = response.meta['uid'] item['content'] = analyzer.get_content(total_pq) item['time'],item['timestamp'] = analyzer.get_time(total_pq) atuser_info,item['repost_user'] = analyzer.get_atuser_repostuser(total_pq) atuser_list = friendcircle.atuser_parser(atuser_info) item['atuser_nickname_list'] = atuser_list #item['atuser_uid']= "" yield item