Selenium XPath Find同级

问题描述 投票:0回答:1

我正在使用Selenium针对Salesforce Lightning应用编写脚本。

我在获取实际可用余额(0.00 GBP)时遇到问题,该余额保存在div // lightning-formatted-rich-text // span标签中

我的想法是,我应该能够找到包含文本“ Available Balance”的div // lightning-formatted-rich-text // span标签,然后从该div标签导航至包含0.00英镑的div标签文本,然后从那里获取文本-但我不确定如何执行此操作。...?[I've added a screenshot of the code here

selenium salesforce siblings
1个回答
0
投票

xpath下方应该起作用

// span [text()='可用余额'] /../../ following-sibling :: div [4] // span

© www.soinside.com 2019 - 2024. All rights reserved.