I Use this code for to print the page source.
HtmlUnitDriver driver = new HtmlUnitDriver(BrowserVersion.CHROME);
driver.setJavascriptEnabled(true);
driver.get("https://www.google.co.in/");
String source=driver.getPageSource();
System.out.println(source);
But it is returning me only this :
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head/>
<body/>
</html>
Why is this happenning..? How can i get the full source code..? Please help