I need to get the data from html but response.css, response.xpath and combination is not working whenever I tried to get the "regular-price" data it always says "none"
I need to get the value text of enter code here which $17.99
here's my code
HTML
<div class="price parbase"><div class="primary-row product-item-price product-item-price-discount">
<span class="price-value">$12.99</span><small class="js-price-value-original price-value-original">$17.99</small>
</div>
</div>
Scrapy python
def parse_subpage(self, response):
item = {
'title': response.css('h1.primary.product-item-headline::text').extract_first(),
'sale-price': response.xpath("normalize-space(.//span[@class='price-value']/text())").extract_first(),
'regular-price': response.css('.js-price-value-original').xpath("@small").extract_first(),
'photo-url': response.css('div.product-detail-main-image-container img::attr(src)').extract_first(),
'description': response.css('p.pdp-description-text::text').extract_first()
}
yield item
output should be regular-price: $17.99
please help thank you!