Hey @Ashutosh, you can use following code snippet to print Stock Market table data using Selenium Webdriver:
public static void main(String[] args) throws InterruptedException {
//set GeckoDriver path for FireFox browser
System.setProperty("webdriver.gecko.driver","C:\\Users\\Nisha_Parekh\\Downloads\\geckodriver-v0.24.0-win64\\geckodriver.exe");
WebDriver driver=new FirefoxDriver();
driver.manage().window().maximize();
driver.get("https://www.nseindia.com/live_market/dynaContent/live_analysis/top_gainers_losers.htm?cat=G");
Thread.sleep(3000);
//Get Row Count
int rowCount = driver.findElements(By.tagName("tr")).size();
//Get Column Count
int colCount = driver.findElements(By.xpath("//tbody//th")).size();
System.out.println("Row count :" + rowCount);
System.out.println("Col count :" + colCount);
//Print table Data
for(WebElement tdata:driver.findElements(By.tagName("tr"))){
System.out.println(tdata.getText());
}
}