Hi Everyone,
I have a scenario where i have to get attribute of a element in first column in web table.
First i am extracting table to DT1 after that i want to get specific attribute lets say “aaname” of Column1 for all the rows in that page. I have done this through For loop already which is taking time to process all records.
So i want to do this with the help of LInQ. Could anyone help me with this.
@ppr @Raghavendraprasad @ClaytonM @supermanPunch @sarathi125 @Yoichi @arivu96
@PrankurJoshi @indra @poorna_nayak07 @Palaniyappan @Nithinkrishna
ppr
(Peter Preuss)
June 1, 2022, 7:54am
2
some more details would help us, as the case has the potential to get solved with alternates.
A general building block could look like this:
find children activity - for getting all elements | output variable: uiChildren
Assign activity:
arrValues = uiChildren.Select(Function (x) x.Get(YourAttributeName).toString).toArray
I have a table like below image, i am extracting to Datatable DT1.
After that i have to get status like below image “Trailer not yet assigned”,that status basically comes when we hover on element. So we are getting value from attribute using get attribute.
As we have many rows we used for loop. but i want to do the same using linq to attribute value of all rows of that particular element.
Hi @Satish_Ch ,
Look into it
UiPath.Core.Activities.GetAttribute Retrieves the value of a specified attribute of a UI element. If you want to find out if an element is enabled or not, please use this activity or the Wait Attribute one, coupled with the aastate attribute, for...
ppr
(Peter Preuss)
June 1, 2022, 8:18am
5
we can grab the hover text with datascrapping:
how to loop data scrapping in a web page. Where the table is spanning over multiple pages and it is inside the pallet.
[image]
In this case the once the inner page (1-18) is done then it move to next page Outer(1 of 3)the do the data scrapping.
We had already used Get attribute and in the for loop for all the rows as we have to get for all rows. We need with Linq
Could you please show us your For-loop sequence?
Here in your case, we have to hover on element which is in column but i have to hover inside element of column1.
I just tried your scenario, its not working for me.
Thanks Anyway @ppr
Could you help me with the linq query only.
ppr
(Peter Preuss)
June 1, 2022, 8:56am
10
when some things are not working in the first round we just do another one.
Can you share some structure details to the hover text (e.g. Browser F12 Webtools Screenshot) Thanks
Satish_Ch
(Satish Ch)
June 1, 2022, 9:28am
12
This will give for only one row right. I need for all rows thats y i am asking for linq.
ppr
(Peter Preuss)
June 1, 2022, 9:29am
13
with find children we collect all elements
Hey @Satish_Ch
This is a bit tricky one. Let’s go step by step please.
Kindly could you please confirm if the hover text is available in the html code (check by inspecting the page) without doing the mouse hover itself!
If the above is true, then we are good to go !
Please confirm.
Thanks
#nK
Satish_Ch
(Satish Ch)
June 1, 2022, 1:58pm
15
yes hover text is available Nithin @Nithinkrishna
ppr
(Peter Preuss)
June 1, 2022, 2:00pm
16
we would assume under the title attribute, right?
Cool @Satish_Ch
Now find children should work perfectly.
Kindly show the inspect screenshot once pls.
Thanks
#nK
Perfect @Satish_Ch
Now just use find children and indicate the table container.
Use the filter as <webctrl tag='DIV' class='asset-box' />
From that we can easily get the attribute, so once you achieve the above please let us know.
Thanks
#nK
Satish_Ch
(Satish Ch)
June 2, 2022, 5:19am
20
yes Performed this step.But when i am trying to get attributes from it, i am unable to do so
1 Like