Here, I am getting page content using phantomjsdriver
. I am able to get the complete content of static web pages.
But,I am not able to get complete content of web pages having ajax calls(dynamic web-pages). When I try the below code
I am able to get the content of dynamic web-pages. But I can't predict the loading time of page. So,I am looking for
functions that tells page as been loaded completely.
WebDriver driver = new PhantomJSDriver(caps);
driver.get("http://www.blackwoods.com.au/search/flat-cut-off-wheels-metal-flexovit/302022874");
thread.sleep(10000);
System.out.println(driver.getPageSource());
driver.quit();
Here, I want to use function other then thread.sleep(10000)
;.
Even I tried with below code. But didn't get the complete content
WebDriver driver = new PhantomJSDriver(caps);
driver.get("http://www.blackwoods.com.au/search/flat-cut-off-wheels-metal- flexovit/302022874");
WebDriverWait wait = new WebDriverWait(driver,15);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("ProductsPane")));
System.out.println(driver.getPageSource());
driver.quit();