代码之家  ›  专栏  ›  技术社区  ›  Pradap Pandian

如何在html中获取文本(get text),该html在Robot框架中的相同标记中包含文本和其他字段?

  •  -1
  • Pradap Pandian  · 技术社区  · 6 年前
        ${cont_num}=    GET TEXT    //*[@id="root"]/div/div/div[2]/div[2]/div/div[2]/h6/text()
        Log    ${cont_num}
    

    下面是HTML enter image description here

    下面是检查的xpath enter image description here

    最后下面是错误 enter image description here

    0 回复  |  直到 6 年前
        1
  •  2
  •   Todor Minakov    6 年前

    移除 text()

    //*[@id="root"]/div/div/div[2]/div[2]/div/div[2]/h6