1
public void pagination(String palavraProcurar) throws InterruptedException, IOException {
        // Optional. If not specified, WebDriver searches the PATH for chromedriver.
        System.setProperty("webdriver.chrome.driver", "D:\\Downloads\\chromedriver.exe");
        WebDriver driver = new ChromeDriver();

        // Open site to analyze
        driver.navigate().to("https://www.**HiddenStore**.com/stores/continente/pt-pt/public/Pages/searchResults.aspx?k="+palavraProcurar+"#/?page=2");
        String html=driver.getCurrentUrl();

        // Printing result here.
        System.out.println(html);
        Thread.sleep(3000);

        //next page
            driver.findElement(By.className("next")).click();

            System.out.println(driver.getCurrentUrl());
        

        /**
         * 
        //Give to JSOUP
        Document doc = Jsoup.parse(driver.getPageSource());
        trabalharSite(doc);

         **/


        driver.close();
        driver.quit();
    }

Browser opens automatically however when i want to click automatically on next page I am getting this error:

Exception in thread "main" org.openqa.selenium.ElementClickInterceptedException: element click intercepted: Element ... is not clickable at point (1021, 954). Other element would receive the click: ...

And inspecting the page I know that next button is in the class "next". I attached the image.

Inspect element of next button

Thank you guys!

MdaCosta
  • 49
  • 1
  • 10

0 Answers0