Hello!
I have been trying to retrieve all the tables of this website (Superintendencia de Pensiones - SP) without having to manually datascrape each table . Basically i want to be able to detect all the tables that exist and then transform these into csvs. So far (refer to the image below) i have made a for each child tht does detect how many tables there are on the website and then i created a variable that will have the idx number of each table so that it can iterate. The problem is that in Assign when i put idxIndex to item.Selector.GetTag(item.Selector.GetTagCount-1).GetAttributeValue(âidxâ).ToString (which should work I believe) it tells me that Error: Object reference not set to an instance of an object.I need this because later on in the Extract Structured Data âTABLEâ in selector i want to put . This would help me iterate through the tables.
Question: Canât you rely on any other attribute which is not the idx?
idx is known as a non-reliable selector, because it relies on many other elements on screen. Maybe you can iterate through tableNames, or any fixed attribute present on each table.
The error coming up to your screen is due to UiPath not finding the idx attribute, and this can be happening because the table doesnât really have one (remember idx is an optional attribute).
Thank you!! At the end it was what i was assigning to the indIndex. I was able to fix it by making a variable that inside the for each child became bigger by one.
just do a while loop with an int variable starting with 1 and inside use a try catch to scrape a table, in the end increase 1 to the index variable, when you get an error then you are over with the tables, dont need find childrenâŚ