Python Forum

Full Version: instagram followers name without suggestion for you
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a question related to using selenium to parse Instagram and get your followers list's name. Please refer to the attached photo.
When I click on followers it will also occur Suggestion for you, how to not get the suggestion for you name.

Is there any way if i click on followers and then get the whole followers page and just search the followers name lsit, and ignore 'suggestions for you' list. The code below have problem, it will get all followers' names list and also include suggestions for you name. how yo not get suggestion for you list?

browser.find_element_by_xpath("//a[contains(@href, '/followers')]").click()
sleep (2)
scroll_box=browser.find_element_by_xpath("/html/body/div[6]/div/div/div[2]")
print(scroll_box.text)
I use specific xpath or css name is able to solve just get the followers list without suggestion for you list as below, but I don't wants to use this method:
browser.find_element_by_xpath("//a[contains(@href, '/followers')]").click()
sleep (2)
scroll_box=browser.find_element_by_xpath("/html/body/div[6]/div/div/div[2]/ul/div")
print(scroll_box.text)
Does the Instagram API not allow you to get this data?