Issue
I am a beginner at scrapy and wish to extract the price (15.00) from the HTML
below
<span class="woocommerce-Price-amount amount">
<bdi>
<span class="woocommerce-Price-currencySymbol">£</span>
15.00
</bdi>
</span>
This code that I have written gives me the entire HTML
.
def parse(self,response):
for product in response.css('div.astra-shop-summary-wrap'):
yield{
'oprice': product.css('span.woocommerce-Price-amount.amount').get()
}
As per what i understand if I add ::text
to span.woocommerce-Price-amount.amount
it should give me the desired output however it gives me a blank output.
Any idea as to how to correctly do this? and what am I doing wrong?
Solution
try span.woocommerce-Price-amount.amount>bdi
Answered By - krishan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.