How to click on each of those numbers and stop the clicking when the amounts of clicks is 60

Hello Everyone,
I am working on an automation project that downloads files from the web and I am having an issue.


In this image, there are 20 different numbers with links that I need the robot to click on the first page. I would like to limit the number of clicks of those numbers to be 60 ( end of page 3 if that helps). I have tried data scraping, having a table of all numbers and use for each row and it just takes the first one of the first page downloading 60 times. I have tried Find children, wildcard in selectors and it does not work either. Is a there a way to click those numbers link and stop at the 60th? I always thought it would work with for each row.
Thank you very much, any help is greatly appreciated!
Boyses

1 Like

can you share your workflow or just the foreach please

1 Like

Unfortunately I cannot as it contains private data. I am not looking for someone to give me a sample file that works, just methods to do what I need the robot to do.
Thanks for answering quickly!

1 Like

No worries, I wasnā€™t wuite sure what you wanted tbh. Is it the case that right now it just cliking the first item 60 times instead of iterating through those 60 items?

1 Like

That is the case now it is just clicking the first one on the first page but not 60 times, I do not know how to fix that click count to 60 that is part of my problem also.

1 Like

Have you put a vriable in your selector for the click? So that itā€™s based on the item from your for each?

1 Like

I am still quite new to UI Path and did not know you could put variable for the click activity. What would it be though? the count of a for each row? because for each row is not working in my case is there any other method you would recommend for that clicking process?

1 Like

Take a look at your selector and see if you can find those file names in one of the attributes. If itā€™s there iā€™d advise using the file names after scraping them.

You might also find an attribute for row number and then you can just have an incrementing number like you suggested.

Iā€™d suggest open uiexplorer twice and secelting a different file in each and comparing the two selectors then you can see how the two elements are distinguished by the robot

2 Likes

Thank you very much, I will try those and will get back to you after

2 Likes

After looking I noticed the 2 selectors have only 1 thing that differs.
webctrl id=ā€˜gwt-debug-referralResultsTableā€™ idx=ā€˜2ā€™ tag=ā€˜TABLEā€™
webctrl tableCol=ā€˜1ā€™ tableRow=ā€˜3ā€™ tag=ā€˜TDā€™
This is the selector for one of them. The only thing that changes is the tablerow number. If I put 20 it will take only the 20th row. Any way to make this going from 1 to 60 and not just a fixed value?

1 Like

Also there are 20 numbers on the first page and if I do limit the result to 20 it is working fine but If I want 21, the 21st will be the one present on the first row of the last pageā€¦any ideas why and how to solve it please?

Before starting, make sure you have the browser saved as a browser variable Iā€™ll call browser1

  1. Use the data scraping wizard to extract the data to a table. Make sure the multiple pages is checked and you set the property to 60 total results. Save the datatable as a variable weā€™ll call dt1.
  2. In a for each row activity, use the ā€˜Navigate Toā€™ activity and supply browser1 variable the ā€˜for eachā€™ loop variable as the website
1 Like

Thank you very much for answering @Dave.
When I use the data scraping wizard and get the option to extract url links in a column the column is empty for all numbers, there is no link. For the for each row activity, I would need to use for each row in dt1 navigate to the browser1 correct? It takes the wrong numbers after the 20th one stillā€¦ ( first number of each page until page 60) any fix with the selector?

Yes, youā€™d but the ā€˜Navigate Toā€™ activity inside the ā€˜for each rowā€™ activity. Unfortunately it is almost impossible to help with selectors if we donā€™t have access to the website or application ourselves. The datascraping tool will often work completely as itā€™s pretty good at recognizing what youā€™re trying to do. However, itā€™s not 100% accurate so you may have to fiddle around with the selectors within it. Iā€™d recommend using the UiExplorer tool to check the various selectors and elements to use

2 Likes

I see, well I will keep trying, thank you very much for your help.

i havenā€™t read much of the replies, but iā€™ve faced a similar scenario in the past and used ā€œclick textā€. load your numbers off your datatable in your for each row, and use click text in side your browser activity, in the for each row. itā€™ll cycle through the numbers and click the matching text :slight_smile:

edit: you say you have 20 items per page and need to click 60? why not use a counter with an if statement in your for each row and simply click the ā€˜next pageā€™ button when it reaches 20 clicks?

Thank you very much for answering @CBlanchard.
I just want to make sure I understand your answer, you are suggesting that after scraping the data from the web and extract to a csv table( for example csv), I should use a for each row activity after opening
the browser then click text for the first row( with indicate on screen feature)? Including the count on the if statement would then require having two of them ( one when count is 20 and another one when count is 40) correct? once it arrived at that number I can click on next page button and go back to the for each row loop?
I will try that but let me know if this is what you meant.
Again thank you very much.

I am having an error with he click text that says that the method or operation is not implementedā€¦ any fix for that?