In my attempts at writing a spider with scrapy, Im trying to extract data from within an element just like you would for a href
eg <tr><td><a href = "www.somelink.com"> would be hxs.select('//tr/td/a/@href').extract()
So what we are doing here is getting the data that is assigned to href
I have a span element that has a class and a data attribute as such
<span class="classname" data="{...data in here...}">
but trying the below produces errors in scrapy, where im selecting the data attribute of the span element where the span elements class = classname.
hxs.select('//div/span[@class="classname"]/@data/').extract()
Is it even possible to pull data from attributes other than href and if so how do I do it?
Thanks
Does it work if you remove the trailing slash after
@data?