Skip to main content

Python's package to scrape Twitter with selenium.

Project description

twitterer

Python's package to scrape Twitter with selenium. Get, like, retweet tweets with automatically.

Usage

  1. Install python package
pip install twitterer
  1. Create .env file at project root.
TWITTER_USERNAME = ReplaceThisToYourOwns
TWITTER_PASSWORD = ReplaceThisToYourOwns

Get tweets and save it

from twitterer import Twitterer

twitterer = Twitterer()
twitterer.authenticate()
tweets = list(
    twitterer.get_tweets(
        url="https://twitter.com/search?q=funny%20filter:videos",
        max_tweets=20,
    )
)

twitterer.save_to_file(tweets)

Like and retweet tweets

.get_tweets() method returns generator. This is real-time processing, so when you use .like() or .retweet() method on tweets, i must be handled by a generator.

from twitterer import Twitterer

twitterer = Twitterer()
twitterer.authenticate()
for tweet in twitterer.get_tweets(
    url="https://twitter.com/home",
    max_tweets=20,
):
    tweet.like()
    tweet.retweet()

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

twitterer-0.0.1.tar.gz (7.7 kB view hashes)

Uploaded Source

Built Distribution

twitterer-0.0.1-py3-none-any.whl (8.5 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