Hi All,
Im trying to get the
following values as variables from a string. please guide me how to achieve this string manipulation
The expected result should be
href= “https://cms-imgp.TEST-cdn.org/img/p/2024322/univ/art/2024322_univ_cnt_4_xl.jpg\ ”
imgALT = “SAMPLE TEXT NUMBER 1”
srcText = “https://cms-imgp.TEST-cdn.org/img/p/2024322/univ/art/2024 *”
The original text variable contains the following string :
figure uipath_custom_id=598na class.txt (503 Bytes)
I am looking to remove all text behind href
search the next "
and get the string from the first " until the next "
I am not sure if I can do this with regEx to have a better process. Im not familiar with RegEx yet
Thank you for your help
postwick
(Paul Ostwick)
December 22, 2023, 7:12pm
3
Why are you trying to parse this instead of using the Get Attribute activity?
not sure how to use that one.
Currently, Im using the following :
Assing Activity :
Var : hrefText
txtOuterhtml.Substring(txtOuterhtml.IndexOf(“href=”) + 6, txtOuterhtml.IndexOf(“target”) - txtOuterhtml.IndexOf(“href=”) - 8)
ppr
(Peter Preuss)
December 22, 2023, 7:49pm
5
Mauricio_Gomez:
txtOuterhtml
when working with an item of DataType: uiElement we can retrieve the Attribute values by
multiple get Attribute Activity
OR
1 grabbing the element and use multiple Codestatements like myUiElement.Get(“href”)
When text is HTML and is from other source origin / input we wold process it with HTML related options
So as presented above we do have different options instead of doing it with Regex
Thank you for your guide.
Actually, Ill need to try on that direction
currently i have the following
ppr
(Peter Preuss)
December 22, 2023, 8:02pm
7
there a few parts and we do feel that different it should be done. When more help is needed then lets clear:
what is the orgin / origin source: text, uiElement …?
I am scraping a web page:
currently, I’m using the following structure
Origin: uiElement
ppr
(Peter Preuss)
December 22, 2023, 8:14pm
9
we recommend better names which are not similar/close to classes or keyword
You can do:
place a breakpoint within the 2second activity within the for each body block (of no second activity is there,drag and drop a comment activity
debug and get paused
use the immediate panel:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible!
and explore / prototype it
element.Get(“AttributeName”).toString e.g.
element.Get(“src”).toString
Thank you for your follow up. Running along the website.
I went down into the attribute called : “outerhtml”
inside the attribute there is a long string that i need to slit more.
ppr
(Peter Preuss)
December 22, 2023, 8:26pm
11
Any reasons why our suggestion along with its descriptions is not tried at your end?
I do a apologize for the confision.
The text that I’m trying to slit comes from a string inside of the attribute (outerhtml) from the element.
I Tried the
element.Get(“src”).toString. however, there is no attribute at the element level called scr.
the scr string is inside of the outerhtml attribute as a text.
ppr
(Peter Preuss)
December 22, 2023, 8:39pm
13
kindly note: we only have a limited insight on what was done , what is needed.
From your screenshots we assume:
Find children should find all img elements
(maybe find children is wrong configured on the filter)
Any analysis can be done within the debugging panels:
element(“tag”).toString - which element is processed
element.Attributes() - which attributes are offered etc
The root of issues is from the value inside of the attribute
I can get Attributes into a dictionary. Ill get the list of the attributes also. however, to clarify the text is inside of a string attribute.
Thank you for your help
ppr
(Peter Preuss)
December 22, 2023, 8:49pm
15
unfortunately the discussion is stretched into a ping-pong.
May we ask you thoshare with us a screenshot of the find children properties? Thanks
ppr
(Peter Preuss)
December 22, 2023, 8:56pm
17
please in a way that we also can read / inspect the settings. we mentioned the filter and want to see what is configured, same for the find scope
Sure
the web page contains a section called Figure.
ppr
(Peter Preuss)
December 22, 2023, 9:04pm
19
Perfect, in the meanwhile have a look at what was done within an immediate panel, when running against a demo img element
I would like to share a visual tree of the web page