Skip to main content

twitter_scraper without API

Project description

Twitter scraper selenium

Python's package to scrape Twitter's front-end easily with selenium.

PyPI license Python >=3.6.9 Maintenance

Twitter_scraper_without_API

This code was developed to extract information from twitter without using API as there are a limitation and costs for using official twitter API. You can extract based on your keyword and time frame (in minutes). You can extract unlimitted number of tweets.

Pre-requests

  • Python 3.6+
  • Browsers(Firefox)

Instalation

you can install from source code using

git clone https://github.com/HamedMinaeizaeim/twitter_scraper_without_API.git

and then run

Python setup.py install 

or you can run

pip install -r requirements.txt

alternatively, you can install using PyPl :

 pip install twitter_scraper_without_API

How to use

To use this library, you just need to import the TwitterScraper scraper class and then specify your keyword search. By default, it will return all tweets within a minute. You can change it to extract tweets in the last n minutes. Here is a code to do that:

 from src.twitter_scraper_without_api import TwitterScraper
 twitter = TwitterScraper('bitcoin')
 twitter.last_n_mins = 3
 twitter.fetch_data()

Export option

You can export data as json, panda (Dataframe) and csv

df = twitter.store_data('dataFrame')
csv = twitter.store_data('csv')
json = twitter.store_data('json')

Privacy

There is no issue with privacy in this library and search is based on publicly avaialble information

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_scraper_without_api-0.0.6.tar.gz (9.5 kB view hashes)

Uploaded Source

Built Distribution

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