0

我正在寻找一种从锚标记中提取 URL 的方法,锚标记在 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>

我想要hrefaction的值,我正在尝试下面的代码 - 这是一个数据抓取

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

但它只给了我href值,但正如我们在hrefaction Ant领导中存在的上述模式值中所见,高度赞赏!

4

2 回答 2

1

您可以使用UI 路径的Get Attribute活动来获取所需的属性值。

在此处输入图像描述

于 2020-06-08T11:17:44.670 回答
0

如果 Get Attribute 不起作用,因为您无法访问 Web 元素或者您从其他地方获取数据,您仍然可以使用如下简单的正则表达式

在此处输入图像描述

使用表达式hrefaction="(.+)"

于 2020-06-08T11:51:31.023 回答