I´m using scrapy to try and retrieve url data in a nested class. I´ve tried following the tutorials and similiar questions, but I´m coming up short in my seeminly simple task.
The page I´m trying to scrape is this one: http://www.leasingcar.dk/privatleasing
For every vehicle on the page I want to get the xpath thats leads to the "data-nice_url" text. The first result should therefore be "/privatleasing/Citro%c3%abn-Berlingo/eHDi-90-Seduction-E6G". But I´m getting an empty data set everytime. I´ve tried varying the xpath without any look.
My code looks like this:
from scrapy.spiders import Spider
from stack.items import StackItem
from scrapy.selector import Selector
class Spider(Spider):
name = "leasingcar"
allowed_domains = ["http://www.leasingcar.dk"]
start_urls = ["http://www.leasingcar.dk/privatleasing",]
def parse(self, response):
hxs = Selector(response)
print hxs.xpath('//div[@class="data-nice_url"]/text()').extract()
Thanks in advance