Data Scraping software's table and using Add Data Row to enter new rows into Data Scrapped DataTable

Please guide me if anyone can!

I have to compare the table values from an accounting software with a CSV file. If I am not wrong, the way to do it is to use Data Scraping on the table.

The issue comes when the window to view the table cannot be maximised, thus I can only scrape a limited amount of rows since I cannot view more past the 10 first rows unless I scroll down the table.

My superior told me to use Add Data Row to add the rows that Data Scraping couldn’t get, but how could that be done? I am totally lost. :frowning:

Does this mean I have to do Data Scraping over and over again? Would that allow for flexibility with the scrapped data? The entries for the table changes, so I need to do must be dynamic/flexible.

1 Like

Hey @beepboop

First think is just indicate the table in the Ui-Explorer and check in the Visual tree of all the rows of the table are available without scroll (you may not see on the screen but still those would been rendered already on the screen)

If that is confirmed from above, You can use Find Children activity to scrape the entire table data.

Hope that helps

Thanks
#nK

1 Like

is there a scroll down button or something?
If there is you can capture the selector(using a click activity or something)
then expand target section in properties and copy the selector here


paste selector in EXTRACT DATATABLE activity and delete/comment the click activity (since its only for capturing the selector)

if it works but you end up capturing duplicates you can use remove duplicate rows activity

1 Like

Hi @Nithinkrishna !

Would it be troublesome if I ask for an example of how that would be done? Since I need to make it into DataTable to allow comparison between the two, would that mean I have to generate Data Table after Find Children?

1 Like

No not at all.

But if you can confirm me that first point which I mentioned like if the elements are available on the visual tree of Ui-Explorer even before scrolling ?

Thanks
#nK

1 Like

Yes, thank you!

They are there, but I don’t know if it’s usable?

It only shows as 10 rows, and I noticed even when I scrolled down more it’s the same. At first I thought it didn’t register the other rows but since it’s the UI, it can only show as 10 rows, right?
This is how it looks on the software. (There are one more row after what you see here).

1 Like

please add picture for more information

you can put datascraping in a while loop,

While loop steps

  1. data scraping to extract datatable

  2. compare last row of table to last row of previous table
    String.join(","c, extractedDt.Rows(extractedDt.Rows.Count-1).ItemArray).equals(String.join(","c, prevDt.Rows(prevDt.Rows.Count-1).ItemArray))

  3. if rows are equal, means we cannot scroll down anymore, so break out of loop

  4. if rows not equal, merge the current extracted table with previous one.

  5. click down arrow
    image

then remove duplicates from result datatable

1 Like

Thank you so much!! I’m like halfway understanding what you’re getting at I think.

  1. So the data scraping would be in the While loop yes?

  2. Do I insert this as the condition? Do I just copy paste what you’ve graciously given me or is there words I have to change so I can use it? I suppose it doesn’t help I know no VB.Net.

  3. This if it’s not equal I use Merge DataTable, right?

  4. Is the clicking down arrow to repeat the Data Scrapping?

@beepboop

Are you using Data Scarping which is at the ribbon in the studio. if you use this, it can extract the same pattern of information without scrolling down

Use below link for doc

try use my template
expand the “While” loop and there are 2 sequences you need to update (i have specified where in the xaml)

  1. data scraping sequence
  2. click “down arrow” sequence
    test11.xaml (15.9 KB)

let me know if there are any errors

1 Like

So @beepboop you mean to say you can visually see all the elements in the visual tree ?

Right ?

Hi Jack! Seems there’s Errors I don’t quite get how to solve.

This confused me, do I make another ExtractedDT variable, since it’s supposed to be DataTable?

and this

Do I make Rows as a variable?
image

Yep! As per the picture I’ve shown you, unless I mistook what you meant?

1 Like

Can you upload your xaml here? Ill check

1 Like

Hey @beepboop

Kindly can you use Find Children it should do the job.

Thanks
#nK

Yes I can do it but I’m unsure how I would use it in tandem with the Data Scraping method?

1 Like

Hey @beepboop

There is no need for data Scraping

Just use find Children and indentify the container.

Check the result for this(debug), then we can do the additional steps.

Thanks
#nK

Hi @Nithinkrishna , I ran it as debug, and no errors came up but since I don’t know how I would check if it works or not, I assumed it worked.

1 Like

Okay @beepboop

Add a dummy log activity as a last step to your sequence and toggle a breakpoint on that log.

Just go to the locals panel in debug mode. There will be your variable which is the output of Find Children the collection of UiElement

Just expand it and check the count as well as text inside each to see that’s the elements from which you need to text.

Kindly check this.

Thanks
#nK

1 Like