// "page 2"
driver.findElement(By.xpath("//div[text() = 'Search']")).click();
driver.findElement(By.cssSelector(".tweet")); // wait for next page & tweets to appear
JavaScriptErrors errors = new JavaScriptErrors(driver);
if (!errors.getErrors().isEmpty()) {
System.out.println("FOUND ERRORS!");
for (JavaScriptErrors.JavaScriptError error : errors.getErrors()) {
System.out.println(error);
}
}
driver.close();