Use selenium to click buttons on Instagram Use selenium to click buttons on Instagram selenium selenium

Use selenium to click buttons on Instagram


You need to let the page load first. I would recommend to set some sleep everytime you interact with the page:

login_link = browser.find_element_by_xpath("/html/body/div[1]/section/main/article/div[2]/div[1]/div/form/div/div[3]/button").click()sleep(7)turnoff_notif = browser.find_element_by_xpath("//button[text()='Not Now']").click()

Another option is to use Selenium Implicit/Explit Wait. See here for more informations.