How to extract html through Javascript executor?
问题 import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; public class oo { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver","D:\\Java\\Lib\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.navigate().to("https://google.com"); JavascriptExecutor js = (JavascriptExecutor) driver; Object s = js.executeScript("return document.body.innerHTML;",null).toString(); System