raj parihar
raj parihar

Reputation: 25

I want to extract Url from an anchor tag in ui path

I'm looking for a way to extract URLs from an anchor tag, anchor tag are rendering like this in DOM.

<a target="_blank" id="Tile_WPQ8_1_3" href="#" onclick="PreventDefaultNavigation(); return false;" hrefaction="https://institutes.kpmg.us/global-energy/webcasts/2020/resilience-in-energy-3.html" clickaction="null"></a>

I want the value of hrefaction, I'm trying below code- it's a Data scraping

<extract>
    <column name2='Url' attr2='href' exact='0' name='Name' attr='text'>
        <webctrl tag="a"/>
    </column>
</extract>

but it is giving me just href value but as we can see in above pattern value present in hrefaction Ant lead highly appreciated!

Upvotes: 0

Views: 3114

Answers (2)

kwoxer
kwoxer

Reputation: 3833

And if the Get Attribute is not working because you cannot access the web element or you get the data from somewhere else you can still use a simple regex like this:

enter image description here

using the expression hrefaction="(.+)" .

Upvotes: 0

NTP
NTP

Reputation: 4448

You can use Get Attribute activity of UI path, to get the value of attribute that you want.

enter image description here

Upvotes: 1

Related Questions