// Path: src/main/java/certh/iti/mklab/easie/extractors/Fetcher.java
// public abstract class Fetcher {
// 
//     public abstract Document getHTMLDocument();
// 
// }


import certh.iti.mklab.easie.extractors.Fetcher;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Action;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.WebDriverWait;

     *
     * @throws InterruptedException
     */
    public void scrollDownEvent() throws InterruptedException {
        String currentDoc = "";
        do {
            currentDoc = driver.getPageSource();
            JavascriptExecutor jse = (JavascriptExecutor) driver;
            jse.executeScript("window.scrollTo(0,Math.max(document.documentElement.scrollHeight,document.body.scrollHeight,document.documentElement.clientHeight));");
            Thread.sleep(4000);
        } while (!currentDoc.equals(driver.getPageSource()));
    }

    /**
     * Scrolls down a specific amount of times
     *
     * @param timesToRepeat
     * @throws InterruptedException
     */
    public void scrollDownEvent(int timesToRepeat) throws InterruptedException {
        Random rand = new Random();
        String currentDoc = "";
        for (int i = 0; i < timesToRepeat; i++) {
            currentDoc = driver.getPageSource();
            int counter = 0;
            while (((Document) this.getHTMLDocument()).select("._hnn7m").size() > 0 && counter <= 600000) {
                Thread.sleep(2000);
                counter += 2000;
            }
            if (counter > 600000) {

// Path: src/main/java/certh/iti/mklab/easie/extractors/Fetcher.java
// public abstract class Fetcher {
// 
//     public abstract Document getHTMLDocument();
// 
// }


// Path: src/main/java/certh/iti/mklab/easie/extractors/dynamicpages/BrowserEmulator.java
import certh.iti.mklab.easie.extractors.Fetcher;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Action;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.WebDriverWait;

     *
     * @throws InterruptedException
     */
    public void scrollDownEvent() throws InterruptedException {
        String currentDoc = "";
        do {
            currentDoc = driver.getPageSource();
            JavascriptExecutor jse = (JavascriptExecutor) driver;
            jse.executeScript("window.scrollTo(0,Math.max(document.documentElement.scrollHeight,document.body.scrollHeight,document.documentElement.clientHeight));");
            Thread.sleep(4000);
        } while (!currentDoc.equals(driver.getPageSource()));
    }

    /**
     * Scrolls down a specific amount of times
     *
     * @param timesToRepeat
     * @throws InterruptedException
     */
    public void scrollDownEvent(int timesToRepeat) throws InterruptedException {
        Random rand = new Random();
        String currentDoc = "";
        for (int i = 0; i < timesToRepeat; i++) {
            currentDoc = driver.getPageSource();
            int counter = 0;
            while (((Document) this.getHTMLDocument()).select("._hnn7m").size() > 0 && counter <= 600000) {
                Thread.sleep(2000);
                counter += 2000;
            }
            if (counter > 600000) {

                break;
