Giter VIP home page Giter VIP logo

selenium-twitter-bot's Introduction

selenium-twitter-bot

Selenium based solution for creating a twitter bot. Selenium is a very powerful tool for web automation and scraping. For making Twitter bot, one can use Twitter api, but its paid. This solution on the other hand is not but does require much more work to get things right.

Features:

  • Logging into your Twitter account
  • Liking tweets of your homepage
  • Searching for some keyword or hashtag
  • Liking tweets of the search results
  • Posting tweets
  • Logging out of your account

Running project locally:

  1. Have python environment setup
  2. Clone the repo and go to the cloned directory
  3. Run pip3 install selenium
  4. Now you may run any of the given example scripts or write and execute your own scripts

Examples:

All the following tasks are completely automated without any manual user input. The script launches Firefox instance and carrys out the tasks provided.

Posting Tweets

tweet2gif

Adding likes to tweets on homepage

tweet1gif

Adding likes to tweets on search results of some query

tweet3gif

Attribution:

This project is inspired from DevEd(@developedbyed) tutorial on Twitter automation using Selenium where he explains how to search for a hashtag and like the related posts. For selecting the elements on the page, class attribute is used by him. I built on top of it and added new features such as posting tweets, adding likes to tweets on homepage, search for any keyword and like related posts and logging out. Since Twitter makes use of dynamic classes now, hence the class based selection no longer works. So I made use of other reliable attributes for selecting the elements. Hence the code will work inspite of dynamic classes.

What's next:

I will be working on adding feature of finding and following new users. Apart from that I will also add features to perform other tasks on tweets such retweeting them.

selenium-twitter-bot's People

Contributors

prateek93a avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.