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://x.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(headless=False)
twitterer.authenticate()
for tweet in twitterer.get_tweets(
    url="https://x.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.3.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twitterer-0.3.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file twitterer-0.3.1.tar.gz.

File metadata

  • Download URL: twitterer-0.3.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for twitterer-0.3.1.tar.gz
Algorithm Hash digest
SHA256 90fc863ace8fd143359be3c08794d449692a642f085526daa4a9c7dacf6df1f1
MD5 5914464526888ce264aeba73425198b0
BLAKE2b-256 3e37c82008c70a2a6c46c38f9dd49435e55be4580d287cfd9c896473200cb1a5

See more details on using hashes here.

File details

Details for the file twitterer-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: twitterer-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for twitterer-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d65272feb0bf086dc3170193aa493efd0e56ab4a0b6cd6d454b9b4ec294544d
MD5 47aeb9c137a1b8885635050e408780cd
BLAKE2b-256 83cd755fd41ac4250174ad5fa3f9c30f92948ce0a25005291a7c31879741f3f4

See more details on using hashes here.

Supported by

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