How can I get special attribute value from tag by scrapy xpath method?

Viewed 33

My tag like below:

<a href="web address value" data-spe-type="aaa" />

I used response.xpath('otherpath/a/@href').get() to fetch value it worked! But I used response.xpath('otherpath/a/@data-spe-type').get() to fetch data-spe-type value, it got nothing! why?

0 Answers
Related