I am trying to collect the review details corresponding to a product. I am not able to retrieve the rating stars option.What can be done to retrieve rating stars details in all reviews using data scraping?
can you please share some more details e.g. url, screenshot, website structures info
Usually you will get the count of the star from the selector,
If it is not can you share the url of the site if it is public
unfortunately it is geo blocked.
a quick google image search did not cleared in details. so just show some screenshots or have a check if the stars are represented by 1 or more images. Check out the case of half stars if it occurs.
You can do it in browser right click inspect element and check e.g. image source url
or doit in UiExplorer stand alone mode (Design > UiExplorer)
This is the screenshot
From this, i need to extract the star rating and replies to comments.No half stars in this case.
so please do right click on the star and select inspect element
or analyze in uiexplorer.
we want to find out the details of the stars and if it is an image or something different
Check as below
You extract this by using regex
Mark as solution if this helps
I don’t think it is an image.When i choose 1 star, it shows like this
Don’t know to decode this.
You choose the element and use get Attributes
That will give you the result, check above post
When i gave ‘inner html’ to getAttribute’ it gave me
What should be given to get the image?
Check the scrapping element combine the *'s and the rating also while scrapping, that will give you correct innerhtml like my output
it looks like the stars a realized as svg items.
I would suggest the same as @ksrinu070184 retrieve thext information from the span aria-label attribute and do later a regex on it. It could also have the potential to combine it with a datascrap approach. Herefore you configure an additional correlated column and post edit the generated extractmetadata column to retrieve the aria-label attribute instead of the text attribute. It would look like this or similar
<column exact="1" name="ratinginfo" attr="aria-label">
This is what you needed. This will do the following (Used IE Browser)
- Read the comment and get star rating count
- If there are
read morebutton in the comment it will click and read the full comment.
- Also every 5 comments it will click
show more review buttonand read the next set of comments. Like this, it will read until the end of the comments.
- Here also handled the end of comments.
Output message box for reading each comment
I have used following selectors:
Star Rating: Use
get attribute activityas mentioned by @ksrinu070184 with inner HTML with selector
<html title='Dr. Robert Mastey, MD | Chattanooga, TN | Healthgrades' /><webctrl parentid='premium-review-section' tag='DIV' class='c-comment-list' /><webctrl parentid='premium-review-section' tag='DIV' class='filled' parentclass='star-rating' idx='1' />which gives the output string containing the following span tags. the no of
span class=hg3-i hg3-i-star-fullgives you the star count (in the image below star count=4).
Comment Text: Used get text activity with selector
<html title='Dr. Robert Mastey, MD | Chattanooga, TN | Healthgrades' /><webctrl parentid='premium-review-section' tag='DIV' class='c-single-comment__comment' parentclass='l-single-comment-container' idx='1' />
Note: in the above selectors idx=1 for the first comment, idx=2 for the second comment like that for remaining comments untill the last comment.
Please let me know if you need anything else and enjoy this XAML file, Refresh your web page first and then run this file.
I have written the anotations inside this XAML for your understanding
Main.xaml (21.6 KB)
Can you provide a screenshot for these activities if possible?
try to reinstall latest UIPath, because these are basic core activities that saying missing or invalid activity.
Although find the following activities missing
<html title='Dr. Robert Mastey, MD | Chattanooga, TN | Healthgrades' /><webctrl parentid='premium-review-section' tag='DIV' class='c-single-comment__comment' parentclass='l-single-comment-container' idx='"+idxCounter.ToString+"' />
<html title='Dr. Robert Mastey, MD | Chattanooga, TN | Healthgrades' /><webctrl aaname='Show more reviews' parentid='premium-review-section' tag='A' />
Note: Place the selector exactly as it is
I am not getting it after re-installing.Can you send screenshots of other inner sequences also.
go to manage package and install uipath.uiautomation.activities hope your missing activity will be resolved.
It’s already installed. Tried updating it. It isn’t resolved. I think the problem is only for downloaded xaml files.
create new folder elsewhere and paste my main.xaml file try to run. If issue still persists. send your XAML file. will see