-2

I am currently working on a bot that logs into instagram, I currently have the script to log in and turn on notifications but when then I get a window pop the code does not click on allow. I have been stuck for quite some time. Thank you in advance for your help. Window Popup

def allow_noti():
allow_noti = WebDriverWait(browser, 20).until(EC.element_to_be_clickable((By.XPATH, 
"//button[contains(.,'Turn On')]")))
allow_noti.click()
allow_browser =  WebDriverWait(browser, 10).until(EC.element_to_be_clickable((By.XPATH, '//* 
[text()="Allow"]'))).click()
allow_browser.click()
  • 1
    Perhaps check out the answers in https://stackoverflow.com/questions/32953498/how-can-i-remove-notifications-and-alerts-from-browser-selenium-python-2-7-7/32954722 –  Jan 02 '20 at 00:35

1 Answers1

0

Hope this helps

public static void main(String[] args) 
{
    ChromeOptions options = new ChromeOptions();    
    options.addArguments("--disable-notifications");
    System.setProperty("webdriver.chrome.driver", "/home/users/ss/bb/chromedriver");
    WebDriver driver =new ChromeDriver(options);
    driver.get("http://google.com");
    driver.manage().window().maximize();
}
user4157124
  • 2,809
  • 13
  • 27
  • 42