Only start learning Python a couple of months ago and trying to build an iG bot with selenium.
I'm have a hard time trying to get the code to click past the log in button and 'not now' button.
from time import sleep
from selenium import webdriver
browser = webdriver.Firefox()
browser.get("https://www.instagram.com/")
sleep(1)
#Cookie popup
accept_cookies = browser.find_element_by_xpath("//button[text()='Accept']").click()
username_input = browser.find_element_by_css_selector("input[name='username']")
password_input = browser.find_element_by_css_selector("input[name='password']")
username_input.send_keys("")
password_input.send_keys("")
#xpath on button
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()
#Notification popup
turnoff_notif = browser.find_element_by_xpath("//button[text()='Not Now']").click()
My "//button[text()='Accept']").click() pushes past the accept cookies popup but why does the same nomenclature not work for pressing 'Not Now' on the following pop up for notifications????
p.s. It was the same for the initial 'log in' button on the home page so I had to post the direct xpath URL but I want to avoid this if possible.
Any help would be much appreciated.