读取 HTML Table Adob​​e DTM 中的头值

Reading HTML Table Head value in Adobe DTM

我正在使用 Adob​​e DTM,我正在尝试从 table 中获取值(我无法控制此格式或命名),我想获取 "Opened Account" 在下面的示例中,但不确定如何在 DTM 中进行?我正在尝试定位 "th.rich-table-headercell" 但不确定如何获取价值?

<table class="rich-table home table" id="startForm:OpenedReviewApps" border="1" cellpadding="0" cellspacing="0"> <colgroup span="0"></colgroup> <thead class="rich-table-thead"> <tr class="rich-table-header"> <th class="rich-table-headercell" scope="colgroup">Opened Accounts</th> </tr> </thead> <tbody id="startForm:OpenedReviewApps:tb"> <tr class="rich-table-row rich-table-firstrow"> <td class="rich-table-cell" id="startForm:Open" style="width:80%"> some data here </td> </tr> </tbody> </table>

可能有更好的方法来执行此操作,具体取决于 what/when/where 您尝试获取值(例如页面加载规则与基于事件的规则),但一般来说,基于您的 html,这是一种方法。

转到规则 > 数据元素,然后单击创建新数据元素

名称 数据元素类似于 "table_header" 或您当前使用的任何约定。

对于类型,选择"CSS Selector"。

对于CSS选择器链,使用"th.rich-table-headercell"(无引号)。

对于得到的值,select"text".

(可选,但推荐)检查 使用 cleanText 选项擦除空格和换行符。

现在,例如,您可以创建一个页面加载规则,并在您的条件或变量字段中使用 %table_header%。或者,如果您需要在自定义代码框中的 javascript 中引用它,请使用 _satellite.getVar('table_header')