gpt4 book ai didi

python - 如何使用 Selenium (python) 找到这个元素

转载 作者:行者123 更新时间:2023-12-04 09:17:07 24 4
gpt4 key购买 nike

如何定位这个元素?
enter image description here

<div _ngcontent-ysj-c5>
<div _ngcontent-ysj-c5 class="list-items unselected"> == $0
<!---->
" Installation "
</div>
</div>
我试过了
driver.find_elements_by_xpath("//[contains(text(),' Installation ')]"). 
&
driver.find_element_by_xpath("//*[text()=' Installation ']").click();
但它不起作用。

最佳答案

这个怎么样:

driver.find_elements_by_xpath("//*[contains(.,'Installation')]")
或者
driver.find_element_by_xpath("//*[.=' Installation ']")
=)

关于python - 如何使用 Selenium (python) 找到这个元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63169412/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com