Skip to content

Instantly share code, notes, and snippets.

@oliver-batey
Created December 23, 2020 19:06
Show Gist options
  • Save oliver-batey/b3a7cb0cc50c4a93d8765b5a2fca3751 to your computer and use it in GitHub Desktop.
Save oliver-batey/b3a7cb0cc50c4a93d8765b5a2fca3751 to your computer and use it in GitHub Desktop.
from instascrape import Hashtag
#Substitute 'ad' with the word you
#want to search for (as a string)
hashtag = Hashtag('ad')
#Scrape the profile
hashtag.scrape()
#Get list of the recent posts
recents = hashtag.get_recent_posts()
#Build dataframe
data = pd.DataFrame([get_post_data(post) for post in recents])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment