Skip to main content

Unofficial Twitter Hashtag Scraper using free proxies

Project description

Twitter Hashtag Scraper

Unofficial Twitter hashtag scraper using free proxies. No API keys required


Installation

pip install twitter-hashtag-scraper

Usage

Import the package and create an object of the scraper using:

  • hashtag (str): hashtag to scrap
  • x_guest_token (str): a valid token from Twitter. You can check the requests in your browser with Developer Tools, XHR filter and search for a request to https://api.twitter.com/2/search/adaptive.json? to obtain the value from the headers.
  • use_proxy (boolean): boolean to activate proxies or not.
  • output_path (str, optional): output path. Defaults to None.
  • max_tweets (int, optional): max number of tweets to download else try to get tweets until scroll is over. Defaults to None.

Then calling the method collect() will retrieve the data. You need to have a valid x_guest_token checking the requests with Twitter.

from twitter_hashtag_scraper import TwitterHashtagScraper

TwitterHashtagScraper(hashtag="#MalagaCF",x_guest_token="1331317358300979202",use_proxy=False,output_path="/Users/youruser/Desktop",max_tweets=60).collect()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twitter-hashtag-scraper-1.2.2.tar.gz (7.8 kB view hashes)

Uploaded Source

Built Distribution

twitter_hashtag_scraper-1.2.2-py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page