Data extraction and download

Hi all,
I am using an application in that application I have rows and columns with data. I need to scrap that data and I need to find out if in 1st column “List Date” is present or not. If that “List Date” is present then I need to download that file.

How should I do it, can you please help me.

Thanks in advance

@hanviprebday
Hi,
Use application browser activity

Use read range
Take for each row in datatable
Take if condition :CurrentRow(“Column1”).ToString.Contains(“List Date”)
Take click activity and use dynamic selector to click on the particular cell

Thanks

Hi @hanviprebday

Us the extract data table activity and store the data in a variable and then use the for each row in data table and use the if condition activity with condition as
CurrentRow(0).tostring.contains("List Date")
and in then do the download actions.

uploaded a sample xaml please refer
sample.xaml (21.0 KB)

Regards

Hi @hanviprebday

Use the Extract Datatable to scrap the data from the webpage and the output is Datatable variable type. Use the if condition to check the datatable contains the column name by below condition.

Datatable.Columns.Contains("List Date")

In then block take a boolflag variable and make it as True in else condition make it as False
Then take one more If condition then check the boolflag = True
In then block use for each row in datatable to iterate the every row in datatable. In loop use the click activity to click on the download file to download file.

If you want to do the click dynamic pass the variable in the click selectors.

Hope it helps!!

Hi @hanviprebday

Follow these:

  1. Use extract datatable and store it in a DataTable.
  2. Use a “For Each Row” activity to iterate through each row in the DataTable.
  3. Within the loop, use an “If” activity to check if the value in the first column (index 0) of the current row is equal to “List Date”.
row(0).ToString().Equals("List Date")
  1. If the condition is true, use “Click,” to download the file by using strict selector.

This is working but I need to know in which row that “List Data” is there. How to get that

Could you please elobarate your query we can’t get you.

Cheers!!

@hanviprebday

CurrentRow(0).tostring.contains("List Date")

Use this in if condition

@hanviprebday

If its equal then use assign activity:
str_var = Row("col_name") (The col_name is the name of the col includes value that you want to click)
Use click to download the file and pass the value in the “aaname” attribute of strict selector of click activity.

Hi,

Take a var Counter=1
In for each loop of datatable:
Increment the counter=counter+1
if condition:row(0).ToString().Equals(“List Date”)
In log message inside the body of if condition print counter
So that you know the row of the list data is present

@hanviprebday

CurrentRow("Document Name").tostring.contains("List of Caution Listed")

Place that in if condition and in then place all the download activities

Regards

In If condition give like this

Currentrow("Document Name").Contains("List of caution listed exporter with cnx no")

Put this condition in If condition and place this If activity in For each row in datatable activity.
In then block give the click activity to click on the download button.

Hope it helps!!

But current row is coming as not declared

@hanviprebday
Hi,

CurrentRow(“Document Name”).tostring.contains(“List of Caution Listed”)

Then show how was it showing. @hanviprebday

Thank you all for helping me

If you find the solution please mark as solution to close the loop. @hanviprebday

@hanviprebday

If you find the solution please mark it as solution

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