I am trying to scrape rating off of trustpilot.com.
Is it possible to extract a class name using scrapy? I am trying to scrape a rating which is made up of five indi
You can extract rating directly using re_first() and re():
re_first()
re()
for rating in response.xpath('//div[contains(@class, "star-rating")]/@class').re(r'count-(\d+)'): print(rating)