I'm putting together a Python script using Selenium that will log into Instagram (my own), and retrieve the total number of followers. I'm having trouble locating the proper Xpath element.
followers= driver.find_element_by_xpath('//*[@id="react-
root"]/section/main/article/header/div[2]/ul/li[2]/a/span')
Using this Xpath turns up nothing.
Has anyone successfully done this before?
Thanks
Following xpath should work
followers= driver.find_element_by_xpath('.//*[contains(text(), "followers")]/span')