def parse(self, response): for sel in response.xpath('//div[@class = "video-wrap"]//ul/li'): num = self.webFunc.getNum(sel.xpath('div/span[@class="num"]//text() | span/span[@class="num"]//text()').extract()[0]) if num >= self.webFunc.limit: item = ZhiboItem() item['title'] = sel.xpath('div//a/text()').extract()[0] item['link'] = sel.xpath('a/@href').extract()[0] item['view'] = num item['img_url'] = sel.xpath('a//img/@src').extract()[0] item['zhubo'] = sel.xpath('a//img/@title').extract()[0] item['web'] = "huya" item['cate'] = self.webFunc.getCate(response.url) # item['active'] = True yield item
def parse(self, response): jsonBody = json.loads(response.body) for sel in jsonBody["data"]["channelList"]: num = self.webFunc.getNum(sel["views"]) if num >= self.webFunc.limit: item = ZhiboItem() item['title'] = sel["channel"] item['link'] = "http://www.huomao.com/" + sel["id"] item['view'] = num item['img_url'] = sel["image"] item['zhubo'] = sel["nickname"] item['web'] = "huomao" item['cate'] = self.webFunc.getCate(response.url) # item['active'] = True yield item
def parse(self, response): jsonBody = json.loads(response.body) for sel in jsonBody["streams"]: num = self.webFunc.getNum(str(sel["viewers"])) if num >= self.webFunc.limit: item = ZhiboItem() item['title'] = sel["channel"]["status"] item['link'] = sel["channel"]["url"] item['view'] = num item['img_url'] = sel["preview"]["medium"] item['zhubo'] = sel["channel"]["display_name"] item['web'] = "twitch" item['cate'] = self.webFunc.getCate(response.url) # item['active'] = True yield item
def parse(self, response): jsonBody = json.loads(response.body) for sel in jsonBody["data"]: num = self.webFunc.getNum(sel["view"]) if num >= self.webFunc.limit: item = ZhiboItem() item['title'] = sel["title"] item['link'] = "http://www.quanmin.tv/v/" + sel["uid"] item['view'] = num item['img_url'] = sel["thumb"] item['zhubo'] = sel["nick"] item['web'] = "quanmin" item['cate'] = self.webFunc.getCate(response.url) # item['active'] = True yield item
def parse(self, response): jsonBody = json.loads(response.body) for sel in jsonBody["data"]["list"]: num = self.webFunc.getNum(sel["totalCount"]) if num >= self.webFunc.limit: item = ZhiboItem() # just slove the space character, need to be improved later item['title'] = sel["introduction"].replace(" ", " ") item['link'] = "http://www.huya.com/" + sel["privateHost"] item['view'] = num item['img_url'] = sel["screenshot"] item['zhubo'] = sel["nick"] item['web'] = "huya" item['cate'] = "lol" # item['active'] = True yield item
def parse(self, response): for sel in response.xpath('//div[@id = "list-con"]/a'): item = ZhiboItem() num = self.webFunc.getNum( sel.xpath( 'ul/li[@class="livecard-meta-item livecard-meta-views"]/span[@class="livecard-meta-item-text"]/text()' ).extract()[0]) if num >= self.webFunc.limit: item['title'] = sel.xpath('h3/@title').extract()[0] item['link'] = sel.xpath('@href').extract()[0] item['view'] = num item['img_url'] = sel.xpath('img/@src').extract()[0] item['zhubo'] = sel.xpath('span/strong/text()').extract()[0] item['web'] = "longzhu" item['cate'] = self.webFunc.getCate(response.url) # item['active'] = True yield item
def parse(self, response): for sel in response.xpath('//div[@id = "live-list-content"]/ul/li'): num = self.webFunc.getNum( sel.xpath('a//span[@class="dy-num fr"]/text()').extract()[0]) if num >= self.webFunc.limit: item = ZhiboItem() item['title'] = sel.xpath('a/@title').extract()[0] item['link'] = "http://www.douyutv.com" + sel.xpath( 'a/@href').extract()[0] item['view'] = num item['img_url'] = sel.xpath( 'a//span[@class = "imgbox"]/img/@data-original').extract( )[0] item['zhubo'] = sel.xpath( 'a//span[@class = "dy-name ellipsis fl"]/text()').extract( )[0] item['web'] = "douyu" item['cate'] = self.webFunc.getCate(response.url) # item['active'] = True yield item
def parse(self, response): for sel in response.xpath( '//div[@class = "bb-variety-area bb-room-list"]/div[@class = "bd"]/ul/li' ): item = ZhiboItem() num = self.webFunc.getNum( sel.xpath('a/div[@class="info-area"]/div/span/span/text()'). extract()[0]) if num >= self.webFunc.limit: item['title'] = sel.xpath( 'a/div[@class="sub-mask"]/p/text()').extract()[0] item['link'] = "http://www.zhanqi.tv" + sel.xpath( 'a/@href').extract()[0] item['view'] = num item['img_url'] = sel.xpath( 'a/div[@class="imgBox"]/img/@src').extract()[0] item['zhubo'] = sel.xpath( 'a/div[@class="imgBox"]/img/@alt').extract()[0] item['web'] = "zhanqi" item['cate'] = "girl" # item['active'] = True yield item
def parse(self, response): for sel in response.xpath( '//div[@class = "live-list-tabc tabc js-room-list-tabc" and not(p[@class = "no-videoList-title"])]/ul/li | //div[@class = "bb-hot-area bb-funny-area bb-room-list" or @class ="bb-variety-area bb-room-list"]/div[@class = "bd"]/ul/li | //div[@class = "video-list-tabc" and not(p[@class = "no-videoList-title"])]/ul/li' ): item = ZhiboItem() num = self.webFunc.getNum( sel.xpath( 'a/div[@class ="info-area"]/div[@class ="meat"]/span/span[@class = "dv"]/text()' ).extract()[0]) if num >= self.webFunc.limit: item['title'] = sel.xpath( 'a/div[@class="imgBox"]/img/@alt').extract()[0] item['link'] = "http://www.zhanqi.tv" + sel.xpath( 'a/@href').extract()[0] item['view'] = num item['img_url'] = sel.xpath( 'a/div[@class="imgBox"]/img/@src').extract()[0] item['zhubo'] = sel.xpath( 'a/div[@class ="info-area"]/div[@class ="meat"]/span[@class = "anchor anchor-to-cut dv"]/text()' ).extract()[0] item['web'] = "zhanqi" item['cate'] = self.webFunc.getCate(response.url) # item['active'] = True yield item