Idx Increment

Dear, good afternoon!

I am using the Data Scraping tool to do structured data scraping, but there are two buttons that have the same characteristics, I would like to know how I can increment the idx = ‘’ and isleaf = '’, below button selector.
<webctrl css-selector = ‘body> app> app-root> div> div> employee-list> main> div> div> tg-div>> div> idx =’ 1 ‘isleaf =’ 1 ‘tag =’ SPAN '/>

1 Like

You can store that value in an integer variable and increment it as you go. Then just do "... idx =’" + count.ToString + "‘isleaf =’" + count.ToString + "‘tag =’ SPAN '/>" for your selector, where count is your variable.

Last I checked you cannot do this directly from the selector editor. You have to remove your selector and reopen the selector window to get to the expression editor, which will allow you to use a variable.

1 Like

yes it can be incremented with a variable assigned to both idx and isleaf
like this
–use a loop either while or do while or for each activity based on your need with a appropriate condition
–inside the loop use a assign activity like this
counter = 1
where counter is a int32 variable
–now use a data scrapping tool and get the selector
–make sure that we are making changes like mentioning that variable in the selector inside the SELECTOR EDITOR, because we need to pass that selector as string (within double quotes)
–now the selector be like this
" app> app-root> div> div> employee-list> main> div> div> tg-div>> div> idx =’ " + counter.ToString + " ‘ isleaf =’ " + counter.ToString + " ‘tag =’ SPAN '/>"

mention this in the selector property as input and not inside the selector editor because changes inthe selector editor especially when mentioning variable wont be taken
so only passing the selector as string will be considered

hope this would help you
kindly try this and let know for any queries or clarification
Cheers @Gilberto

1 Like