【问题标题】:How to locate the element inside the <p> tags?如何定位 <p> 标签内的元素?
【发布时间】:2022-11-14 21:54:02
【问题描述】:

我在这种标签中有一些元素,如下所示:

enter image description here

我如何找到这些元素

我试图找到 Selenium C# 不起作用的上述元素

【问题讨论】:

  • 你究竟尝试了什么?面临哪些错误?分享您的代码试验

标签: c# selenium selenium-webdriver


【解决方案1】:

给你正在寻找的 p 标签一个 id。然后使用查找元素

var driver = //whatever your driver is;

driver.FindElement(By.Id("element-id-goes-here"));

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多