-1

I have automated the login and getting to the downloading page where i have some pdf's which i want to download. These pdf's are dynamic ,sometimes there are 10 sometimes 100 ,it changes everyday.i want to download those pdf's . please find the attached image enter image description here

Here i want to download the pdf by clicking each elements in column 3(hyperlink highlighted in blue colour) ,the number of rows in the table is dynamic.how can i do it using UIPATH.

DataDoctor
  • 113
  • 1
  • 3
  • 11

2 Answers2

3

From the top of my head, without knowing the application you are working in I see a few different approaches you can try:

Approach 1: Extract table as Data Table

Perhaps you can extract the table as a Data Table, enumerate the rows and find the individual link selectors you then can pass to a click activity.

Approach 2: Dynamically manipulating the selector

Use UIExplorer to find the selector of the link in the third column. Typically the attribute idx is the unique identifier. You can construct your own variable idx and in a while loop increment this variable while passing it to a click-activitys selector: "<your normal selector here someAttr="something" idx="+idx.ToString+"/>

This way, when the click fails with selector not found you will be at the last row of the column and you can exist the while loop.

Approach 3: Using Find Children

Another approach is to use the Find children activity on the column or table to get the children, i.e. the rows. You need to know which filter to use, it is basically the selector. Find children outputs a IEnumerable<UIElement> you can iterate and pass to a click activity

Mads T
  • 530
  • 3
  • 14
  • Approach 1 is the best one and the convenient one ,i am able to download the report but it seems like i am only downloading the first report over and over again. Please find the attached ui flow image url , [link](https://imgur.com/a/oCeEJxF) [link](https://imgur.com/a/j7L7MFh) – DataDoctor Nov 22 '19 at 12:07
  • Your Click TD inside the for each. What does it click on? Can you share the selector? – Mads T Nov 22 '19 at 12:22
  • it will iterate each row and while iterating it will click the link and it will download the first report ,then go to the second row and do the same. i can see it's detecting the correct the number of rows and that's why it is downloading the first report as many times as i have the rows – DataDoctor Nov 22 '19 at 12:37
  • Yes, but if you do not change your click activitys selector each iteration you willl click the same link again and again. So you need some information captured in your datatable. How it looks I cannot say, but try to look at the third column (your file link column). It takes some messing around with the actual application.. – Mads T Nov 22 '19 at 13:22
1

The shared image is a perfect case of scraping a table from Web page which can be done through UiPath's Data Scraping Wizard, refer this tutorial. This will convert your html table into DataTable. This Data Scraping Wizard will take care of dynamin number of rows as well as the pagination (if exist).

Later, you've to iterate the DataTable (ForEach activity) and hit the link to download PDF files.

manurajhada
  • 5,284
  • 3
  • 24
  • 43
  • I used the web scrapping tool , Now i can download the report but i am downloading the same report over and over again.Please find the attached uipath flow url [link](https://imgur.com/a/oCeEJxF) [link](https://imgur.com/a/j7L7MFh) – DataDoctor Nov 22 '19 at 12:04
  • there is a bug in your code, you should increase the incremental variable and make sure download link variable is getting updated. Put some logs or message boxe to debug this issue. – manurajhada Nov 22 '19 at 12:06
  • [link](https://imgur.com/a/qlbqn7n) it's just a simple click action – DataDoctor Nov 22 '19 at 12:47