Download PDF files conditionally across 30 pages

Hello everyone,

I am having trouble with a UI Automation.

Background

  1. I am tasked with downloading all PDF files from a web page categorized as “NEW”
  2. The list has 3000 records across 100 pages
  3. The next page is selected by a drop down menu

Issue

  1. I am having a difficult time with this automation
  2. I tried using find children for each for each page in the drop down and I cannot get the automation to work

Can someone please help me better understand where I am going wrong?

Here is an example of the webpage:

Thank you

1 Like

Hey @MF.RPA

First scrape all the new items from the website and add it to queue.

Process queue items one by one by performing the download step

Thanks
#nK

@Nithinkrishna

Hello,

Are you suggesting to use the screen scraping activity to loop through each of the pages, create a list of new items, add the items to the que and then execute the download?

I tried doing this but was having difficulty looping through the pages.

Thank you,

1 Like

Yes, this will be one of the best approach to keep track.

Or else, when we download the item to the machine will the status on the Portal changes from New to something else ?

Kindly confirm.

Thanks
#nK

How do I screen scrape each page? It seems like the application will only screen scrape the current page.

I was trying to build a list to find the children in the drop down boxes that contain the other pages.

1 Like

Yes @MF.RPA, It’s possible.

  1. Use Find Children to get the pages list

  2. Iterate through the list using For Each loop

  3. For every iteration, Use Find children to get all the new items from the table

  4. Process every item by using a For Each loop


Hope this helps

Thanks
#nK

I used find children to build a list of pages (Variable: Pages)
I then used the for each loop (For Each item in Pages)
I then used the find children activity to build a list of all records.

Issue
I am not sure how to specify to select only new records.

@Nithinkrishna I was able to use data scraping to build a data table but I having a problem where I download the same PDF file each time regardless of status.

Here is the data table that I exported to excel as an example (Focus on column H (Status))

In the first step of the workflow I have used screen scraping to build a list of all records
DT = ExtractDataTable

In the second step I use for each row in ExtractDataTable

I use an in if condition
Row(7).ToString.Contains(“New”)
(I use received in my example to avoid downloading new records during testing)

In the third step
If the Status contains “New (Received)” the application should do the following

  1. Click status each time to refresh the record list (This works)
  2. Click and download the PDF file if the condition is met “Row(7).ToString.Contains(“New”)”

ISSUE: The application will download every file regardless of status

Question: Do you know how to ensure that I only download new files?

this might be due to selector , have you check your selector , and does it hightlight the correct itemm based on the condition you want?

@Ahmad_Rais

Thank you for the reply

When creating the data scrape, I select the status header to create the table. The status header lights up when selected.

Below you will find additional information. It looks like the status property is “aaname”. Does this need to be specified somewhere?

image


image
![image|337x424]

aa name is my selector
![image|248x500]
(upload://asDEmXLIDmW9ExKt8MZIS8PlNGi.png)

When I click on the extract structured data table activity and then look at the selector I receive this
<uia role='table' /> <uia role='item' tableCol='1' tableRow='2' /> <uia role='table' /> <uia role='item' tableCol='1' tableRow='3' /> <uia role='table' /> <uia role='item' tableCol='0' tableRow='0' /> <uia idx='2' role='table' />

For those following my activity, I have made significant progress today. I needed to add a dynamic selector and index the dynamic selector int variable.

I am still left with one remaining problem. My robot will not download just new items. The robot appears to identify the first “new” file and then downloads each item regardless of status below the first file.

Does anyone have any ideas as to how I can ensure that I am only downloading items with the status of “New”?

I am already using an IF condition:
“row(7).ToString = “New””

How to create a dynamic selector:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.