I have an HTML document where I’m looking for a specific word that is in a table. Now I need an approach that allows me to search this particular word and then copy the value to the right of it.
I have already tried different methods and found “Find Element”. UiPath can read the word, but I get “UiPath.Core.UIElement” as output and not the word itself. With “GetText” I copy the value to the right of the word. This works fine. In addition, I have replaced the exact value of the selector with a wildcard (*). Then I have the problem that UiPath takes the first result of the table instead of the value which stands on the right from the word I search for.
On the example of the table I want to find the word “Höhe” and would like to copy the value “345”. When replacing the exact value with the wildcard *, however, I get the value “123” from the first attribute in the table. So, the RPA doesn’t find the word in my opinion.
Can someone help me to find a method to find the exact word on the page and get the right value?
I am very grateful for every tip!
Buddy kindly follow the below steps that could resolve your issue @cathschaen
use find text position activity and pass the text input as “Hohe” and output will be a uielement get that output variable as out_element
Here comes the solution for you
use a anchor base activity, with find element on left side and get text on right side
pass the variable out_element obtained previously as input to element property in find element,(no need to mention the selectors if uielement is passed as input)
while in get text do the same as how you did previously to get the element and create selectors, change the dynamic one with wildcards as well,
Thats all buddy you are done
First of all thanks for the fast reply @Palaniyappan , but I still have some questions.
That is what it currently looks like, but I still have problem with following steps:
3.I am not sure how to pass the variable, to the find element activity. I put it in Target → Element, but I get an error (The following overload groups are configured: Element, Selector. Only one overload group should have its arguments configured.)
4. I previously tried to solve my problem with an anchor base activity, but I still have the same problem with it: I can’t change the selectors like I want to (over Ui Explorer)
for second one, use only one as a key to help the bot to find the element, so if you mention the element dont use selector, remove that selector property empty and mention the element property with the variable that you obtained from find text position.
Buddy once select the element in get text activity you cannot make changes with that element buddy, doesn’t mean that it will act dynamically it will act for sure,
@Palaniyappan I can extract the data with data scrapping and get a datatable. I understand the basics to work with datatables in UiPath but i have no idea about all the functions that exists. How would you extract the data I need? Could you give me a tip?
Great so now you were able to get the datatable right
Fine to get the data you need from the datatable kindly follow the below steps
use for each row loop to iterate through each row in the datatable by passing the datatable obtained from data scrapping as input
use a if condition like this
row(“Bexeichnung”).ToString.Equals(“Hohe”)
if this condition gets passed in then part of if condition use a assign activity to get the right value of it like this
assign activity if the right value of Hohe is in 3 column then
outright_value = row(2).ToString
Thats all buddy this would give you the right value as you expect
@Palaniyappan You are my hero! It worked - thank you!
Have still some problem with the column titles. So instead of “Bezeichnung” I have “Column-1”. Do you have an idea how to change? I found some Videos but they only worked with excel files as input.
And what if want to search for more words. Do I need to do a “For each row” activity for every word I want to search?
Once you get the datatable from scrapped data, remove datarow activity to remove the first row by mentioning the row index in the property that would remove the row
,Bezeichnung,
Fine then you can change the column like this
myDataTable.Columns(0).ColumnName = “newColumnName” using an assign activity
Yes buddy you can use for each row loop to iterate through each rows in the datatable buddy and use assign activity like this
Out_value = row(“columnname”).ToString
Thats all buddy you are done…
Kindly let know once it it works
Cheers @cathschaen