'Click follow button if possible and close tab after checking/following Instagramm with Selenium [closed]

I tried with xpath, find by name etc. but it always doesnt find the follow button i already made it sign in accept cookie and all that i can give the code i got in discord i dont wanna do it here because of a certain reason, Thanks for any help

driver.find_element_by_xpath('//*[@id="react-root"]/section/main/div/header/section/div[1]/div[2]/div/div/div/span/span[1]/button').click()

ik its deprecated btw. Brave TheRealChicken#4398 I tried it at other threads on this forum but they dont seem to work



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source