找硒xlink:href与python

2024-09-29 21:36:41 发布

您现在位置:Python中文网/ 问答频道 /正文

如何在使用Python的页面上找到这个元素?在

在xlink:href=“/assets/images/add.4dcdff54.svg”

谢谢。在


Tags: svg元素页面xlinkhrefimagesassetsdcdff54
1条回答
网友
1楼 · 发布于 2024-09-29 21:36:41

我对Python或XLink不是很在行,但是如果您希望找到一个有锚定标记的元素,请使用:

String path = "//a [@href='page_name.php']";
WebElement navbar = (new WebDriverWait(m_driver, 10))
        .until(ExpectedConditions.elementToBeClickable(By.xpath(path)));

上面的代码是用Java编写的,如果有人能编辑它并为Python编写一个等价的代码,那就太好了。在

相关问题 更多 >

    热门问题