I am trying to extract information from a Facebook page using Selenium. (I am writing in Java). The problem is that after entering the site, a pop-up window appears

enter image description here

And I do not know how to remove it. I tried using the command

driver.switchTo().alert().dismiss(); 

Or

 driver.switchTo().alert().accept(); 

But does not respond. Help me please.

    1 answer 1

    I found the answer to my question. When creating the WebDriver object, you had to configure disabling notifications from the browser.

     ChromeOptions options = new ChromeOptions(); options.addArguments("--disable-notifications"); System.setProperty("webdriver.chrome.driver","path/to/driver/exe"); WebDriver driver =new ChromeDriver(options); 

    Problem solved.