Instagram URL's scraper


#1

Hi there guys,

Can anyone suggest the Instagram scraper which can help to grab links from profiles? I mean I need the output like
Instagram username/URL which user put in his link field.
For example, jamesbond / http://facebook.com/jamesbond

Any help would be much appreciated! :slight_smile:


#2

write one yourself…I will give you something to help you get started using python + selenium.


from selenium import webdriver

browser=webdriver.Firefox()
_#you need to give this loop a userlist or find a way to implement something that will walk _
#around instagram depending on if you have a targeted audience
for username in userList:
browser.get(‘https://www.instagram.com/{}’.format(username))
bio=browser.execute_script(“return window._sharedData.entry_data.ProfilePage[0].graphql.user.biography”)
if ‘http’ in bio:
url = bio[bio.find(“http://”):]
url = t[:t.find(" ")]
print(username+’/’+url)

Above code is just something I put together quickly so not tested but you get the idea. You will need to fill in some blanks, like error handling if you can’t get the ig page for any particular user (eg account no longer valid, you are looping too fast and hit some IG rate limit, etc)


#3

also this forum’s text formatter removed all my python loop and if indentations :face_with_raised_eyebrow:


#4

Try Octoparse Task template.