【问题标题】:What are some ways to access WebElement objects contents?访问 WebElement 对象内容的方法有哪些?
【发布时间】:2020-09-22 22:05:35
【问题描述】:

我有一个 WebElement 对象,但想使用更多搜索功能来访问较小的 html 元素及其各种特征。 element.text 产生所有文本,但我也想在对象内找到 href 值,最好使用 xpath。

【问题讨论】:

    标签: python


    【解决方案1】:

    这是另一个问题,有人回答了寻找 WebElements 属性:How can I get the current contents of an element in webdriver

    我已经使用 element.get_attribute('innerHTML') 但是它只提供字符串形式的原始 html,我不知道如何使用更多的 selenium 搜索功能,如 xpath。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-14
      • 2010-09-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多