Answers for "how to extract text from a web page using selenium and save it as a text file"

0

how to extract text from a web page using selenium and save it as a text file

System.setProperty("webdriver.chrome.driver","C:\\Users\\priyj_kumar\\Downloads\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://en.wikipedia.org/wiki/Main_Page");
String str = driver.findElement(By.xpath("//*[@id='mp-tfa']/p")).getText();
System.out.println(str);
Posted by: Guest on April-16-2020

Code answers related to "how to extract text from a web page using selenium and save it as a text file"

Browse Popular Code Answers by Language