[英]Python Selenium can't find XPath
你有身份證,用它。
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.