Beispiel #1
0
 def parse(self, response):
     #print("huya parse \n")
     #print(response.body)
     #print(self)
     #root_path='//div[@id="live-list-content"]/ul/li'
     root_path = '//div[@class="video-unit"]/ul[@class="video-list"]/li'
     title_path = './/div[@class="all_live_tit"]/a/text()'
     href_path = './/a/@href'
     img_path = './/span[@class="txt all_live_txt"]/span/img/@src'
     author_path = './/a/img/@alt'
     audian_path = './/span[@class="txt all_live_txt"]/span[@class="num"]/i/text()'
     url_prefix = ""
     vtype = './/a/@eid_desc'
     vkey = href_path
     SpiderPathUrl.process(response, root_path, title_path, href_path,
                           img_path, author_path, audian_path, url_prefix,
                           vtype, vkey, "huya", "")
Beispiel #2
0
    def parse(self, response):

        #print(response)

        #root_path='//div[@id="live-list-content"]/ul/li'
        root_path = '//li'
        title_path = './/h3[@class="ellipsis"]/text()'
        href_path = './/a/@href'
        img_path = './/img/@data-original'
        author_path = './/span[@class="dy-name ellipsis fl"]/text()'
        audian_path = './/span[@class="dy-num fr"]/text()'
        url_prefix = "http://www.douyu.com/"
        vtype = './/span[@class="tag ellipsis"]/text()'
        vkey = './/@data-rid'
        SpiderPathUrl.process(response, root_path, title_path, href_path,
                              img_path, author_path, audian_path, url_prefix,
                              vtype, vkey, "douyu", "")