【问题标题】:1)How to get the xpath to get a text without a tag on the same level of other tags1)如何让xpath获取与其他标签同一级别的没有标签的文本
【发布时间】:2023-01-20 21:49:03
【问题描述】:

我正在尝试获取“workbasket_598F”的 XPath。但是当我给它时 //div[contains(text(),'Workbasket Name')]//following::tr[1]/td[1]//div /script 它没有检测文本,它检测的是

enter image description here

【问题讨论】:

  • 请至少提供网址或源代码(作为文本)

标签: selenium selenium-webdriver xpath


【解决方案1】:

您可以使用 //div[@class="oflowDivM "]/text() 获取该字符串,它基本上将返回位于 <div class="oflowDivM "> 内的文本,该文本未包含在任何标签中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-04-26
    • 2019-09-19
    • 1970-01-01
    • 2019-07-20
    • 2017-09-07
    • 1970-01-01
    • 2014-01-14
    • 2015-01-27
    相关资源
    最近更新 更多