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.
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
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)
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.
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.
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
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.