Data scraping-Only accepts string values

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?

1 Like

@Gopalakrishnan_K
can you please share some more details e.g. url, screenshot, website structures info
Thanks

@Gopalakrishnan_K

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

Thanks

@Srini84

@Gopalakrishnan_K
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)

@ppr


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

@Gopalakrishnan_K

Check as below

You extract this by using regex

Mark as solution if this helps

Thanks

1 Like

Hi @ppr
I don’t think it is an image.When i choose 1 star, it shows like thisconsole
Don’t know to decode this.

@Gopalakrishnan_K

You choose the element and use get Attributes

That will give you the result, check above post

Thanks

Hi @Srini84,
When i gave ‘inner html’ to getAttribute’ it gave me


What should be given to get the image?

@Gopalakrishnan_K

Check the scrapping element combine the *'s and the rating also while scrapping, that will give you correct innerhtml like my output

Thanks

@Gopalakrishnan_K
it looks like the stars a realized as svg items.
I would suggest the same as @Srini84 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">

@Gopalakrishnan_K

This is what you needed. This will do the following (Used IE Browser)

  1. Read the comment and get star rating count
  2. If there are read more button in the comment it will click and read the full comment.
  3. Also every 5 comments it will click show more review button and read the next set of comments. Like this, it will read until the end of the comments.
  4. Here also handled the end of comments.

Output message box for reading each comment

I have used following selectors:

  1. Star Rating: Use get attribute activity as mentioned by @Srini84 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-full gives you the star count (in the image below star count=4).
    image

  2. 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)

Hi @Vishal_K


Can you provide a screenshot for these activities if possible?

@Gopalakrishnan_K

try to reinstall latest UIPath, because these are basic core activities that saying missing or invalid activity.

Although find the following activities missing

image
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='"+idxCounter.ToString+"' />

image
Selector:
<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

Hi @Vishal_K,
I am not getting it after re-installing.Can you send screenshots of other inner sequences also.

@Gopalakrishnan_K

go to manage package and install uipath.uiautomation.activities hope your missing activity will be resolved.

Hi @Vishal_K,
It’s already installed. Tried updating it. It isn’t resolved. I think the problem is only for downloaded xaml files.

@Gopalakrishnan_K

create new folder elsewhere and paste my main.xaml file try to run. If issue still persists. send your XAML file. will see