簡體   English   中英

Python Selenium 找不到 XPath

[英]Python Selenium can't find XPath

我需要找到文本的 XPath(你能找到我嗎?): 在此處輸入圖像描述

嘗試了大約 10 分鍾,但無法做到。

你有身份證,用它。

driver.find_element_by_id("modal-root-header").text

如果 id 由於某種原因不是唯一的,請使用 xpath:

driver.find_element_by_xpath("//h4[@id='modal-root-header']").text

如果.text不起作用,請嘗試.get_attribute("value").get_attribute("innerText")

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM