I am trying to get the products’ ratings of a webpage. The rating is in <bl-rating>:
To get the title of the product, I did:
'title':product.css('h2::text').get()
Is there a way to get the rating (4.714…) using a similar technique?
>Solution :
Rating isn’t text node value rather attribute value.So You have to invoke ::attr(rating) instead of ::text to get that value as string/text.
'rating':product.css('bl-rating::attr(rating)').get()
