Webdriver script to create web scrap automation script?

0

Webdriver script to write scrap automation script?


package scs;


import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.support.ui.Select;

import java.io.*;

public class SearchRoom {


public static void main(String[] args) throws IOException {

System.setProperty("webdriver.chrome.driver", "c://chromedriver.exe");

WebDriver scs= new ChromeDriver();

scs.get("https://shivaconceptsolution.com/test.html");

//System.out.println(scs.getCurrentUrl());

//System.out.print(scs.getPageSource());

FileWriter f = new FileWriter("d://scrap.txt");

BufferedWriter bw = new BufferedWriter(f);

bw.write(scs.getPageSource());

bw.close();

}


}

    







Post a Comment

0Comments

POST Answer of Questions and ASK to Doubt

Post a Comment (0)