Questions tagged «document.evaluate»

9
有没有一种方法可以使用Selenium WebDriver中的JavaScript通过XPath获取元素?
我正在寻找类似的东西: getElementByXpath(//html[1]/body[1]/div[1]).innerHTML 我需要使用JS获取元素的innerHTML(要在Selenium WebDriver / Java中使用它,因为WebDriver本身无法找到它),但是如何? 我可以使用ID属性,但并非所有元素都具有ID属性。 [固定] 我正在使用jsoup在Java中完成它。这符合我的需求。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.