I am looking for something like:(我正在寻找类似的东西:)
getElementByXpath(//html[1]/body[1]/div[1]).innerHTML
I need to get the innerHTML of elements using JS (to use that in Selenium WebDriver/Java, since WebDriver can't find it itself), but how?(我需要使用JS获取元素的innerHTML(要在Selenium WebDriver / Java中使用它,因为WebDriver本身无法找到它),但是如何?)
I could use ID attribute, but not all elements have ID attribute.(我可以使用ID属性,但并非所有元素都具有ID属性。)
[FIXED]([固定])
I am using jsoup to get it done in Java.(我正在使用jsoup在Java中完成它。) That works for my needs.(这符合我的需求。)
ask by pMan translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…