Social Media Scraper
Create an instance of the PyScrappy library to interact
with the class SocialMediaScraper
Helps in scraping instagram data (name, posts, followers, following, bio, captions).
1. Instagram2. Twitter3. YouTube
#
Typeclass
#
NoteCreate an object of this class to procced further.
#
Exampleobj = PyScrappy.SocialMediaScrapper()
#
InstagramInstagramScrapper
#Helps in scraping instagram data (name, posts, followers, following, bio, captions).
1. Paragraph 2. Header 3. Text
#
Typeclass
#
NoteCreate an object of this class to procced further.
#
Exampleobj = PyScrappy.SocialMediaScrapper.InstagramScrapper()
#
MethodsHere are certain in-built methods of the Instagram Scrapper. Feel free to explore them.
1.account_scrapper()
#Helps in scraping instagram data (name, posts, followers, following, bio, captions)
#
return typepandas.DataFrame
(for captions)#
Parametersinsta_handle
: Enter the desired Insta handle/username.
Type: strn_pages
: Enter the number of pages that you want to scrape.
Type: int#
NoteMake sure the Instagram account is
public
, after certain number of runs, Instagram will ask you for your Instagram ID and PASSWORD, kindly enter it to continue.#
Exampleobj = PyScrappy.SocialMediaScrapper()obj.InstagramScrapper.account_scrapper('Public_account_name', 3)
2.hashtag_scrapper()
#Helps in scraping instagram data (captions)
#
return typepandas.DataFrame
(for captions)#
Parametershashtag
: Enter the desired hashtag.
Type: strn_posts
: Enter the number of posts that you want to scrape.
Type: int#
NoteAfter certain number of runs, Instagram will ask you for your Instagram ID and PASSWORD, kindly enter it to continue.
#
Exampleobj = PyScrappy.SocialMediaScrapper()obj.InstagramScrapper.hashtag_scrapper('Public_account_name', 3)
#
Twittertwitter_scrapper()
#Helps in scraping data from Twitter ('Name', 'Twitter Handle', 'Post Time', 'Tweet', 'Reply Count', 'Retweet Count', 'Like Count').
#
Return typepandas.DataFrame
#
Parametershashtag
: Enter the desired hashtag, of which you want to scrape data of.
Type: strn_pages
: Enter the number of posts that you want to scrape.
Type: int#
NoteBoth the arguments are a compulsion. If
n_pages == 0:
A prompt will ask you to enter a valid page number and the scrapper will re-run.obj = PyScrappy.SocialMediaScrapper()obj.twitter_scrapper(hashtags, n_pages)
#
YouTubeyoutube_scrapper()
#YouTube Scrapper: Helps in scraping YouTube data ('Title', 'Video_url', 'Views', 'Days').
#
Return typepandas.DataFrame
#
Parametersvideo_sec_url
: Enter the desired YouTube URL (only video section)
Type: strn_pages
: The number of pages that it will scrape at a single run
Type: int#
NoteMake sure the url is a valid YouTube url, and please enter the url ending with
'videos'
, i.e urls only from the video sections are acceptable. The scraping limit isunlimited
.obj = PyScrappy.SocialMediaScrapper()obj.youtube_scrapper(video_sec_url, n_pages)