I am trying to extract customer feedback from Online consumer website like Rating of the customer for the product. Using Data Scraping, am extracting Customers Name, Date, RATING & review part from the Trustpilot website into ‘DataTable’ variable and then writing it to an Excel sheet.
URL: BT Reviews | Read Customer Service Reviews of bt.com | 2 of 557
However, the Rating part extracted into Excel sheet showing as null(blank).
I have tried the same in other websites like Amazon and can fetch the ratings from the comments.
Not sure if this is due to UI element inconsistency in fetching the data from the website.
I have tried to update the selectors, however, am still not able to get the rating.
PLease find the screenshot below:
If the value of the attribute is stored as a class/id name, you will want to change attr=‘text’ into attr=‘className’.
Actually, it is a bit trickier than I originally thought. The rating is actually just a color-change of particular element. I am not sure how to get it, actually. I hope someone will be intrigued by it and will solve it for us
I’m glad it worked out for the previous website. Unfortunately, for this second website it is most likely a bit more tricky (but not impossible).
This method might be slower, because there is no attribute of the div tag that contains the amount of stars in a review. This means that you will need to add the review star count after you have scraped the page from other data and it comes with a few additional challenges.
But I will focus just on getting the star review value.
The only way I see to determine the value of the review is to get children of the div encapsulating all the stars: