Ejemplo n.º 1
0
    def parse_item(self, response):
        hxs = HtmlXPathSelector(response)
        item = TextDataItem()

        item['name'] = "".join(hxs.select('//*[@id="H2naslov"]/text()').extract())
        tt = hxs.select('/html/body/form/table[3]')
        item['text'] = "\n".join(tt.select('.//p//text()').extract())
        item['kind'] = 'vest'
        item.meta['author'] = 'a1.com.mk'
        item.meta['style'] = 'vesti'
        item.meta['url'] = response.url
        return item
Ejemplo n.º 2
0
    def parse_item(self, response):
        hxs = HtmlXPathSelector(response)
        item = TextDataItem()

        item['name'] = hxs.select('//*[@id="ArticleTitle"]/text()').extract()
        if item['name'] is None or len(item['name']) == 0:
            return None
        item['text'] = hxs.select('//*[@id="ArticleText"]//text()').extract()
        item['kind'] = hxs.select('//*[@id="ArticleHeading"]/text()').extract()
        item.meta['author'] = hxs.select('/html/body/div[2]/div[2]/table/tbody/tr/td[3]/table[4]/tbody/tr/td/table/tbody/tr/td[3]/div[11]/table/tbody/tr/td/p[5]/text()').extract()
        item.meta['style'] = 'vesti'
        item.meta['url'] = response.url
        return item