Giter Club home page Giter Club logo

sahib's Introduction

Sahib

Overview:

Python bot that scrapes Walmart's clearance page for electronics to find the best deals and post them on Twitter automatically. The bot scrapes data using the Selenium framework for Python, and the data is then stored in a MongoDB collection to be tweeted later. Using Windows Task Scheduler, the script was made into a CRON job to tweet 5 deals daily.

Data Flow:

Scraping from Walmart:

1. Using Geckodriver, a Webdriver for Firefox is created that opens Walmart's clearance page for electronics
2. The products are then scrapped using Selenium, and data such as the product's title, new and old price, and when it was scrapped is recorded
3. Calculations are done to determine the discount percentage and price, and then using DNSPython products are sent to be stored in a MongoDB collection

Scraping from Twitter:

1. Using Geckodriver, a Webdriver for Firefox is created that opens Twitter's log-in page
2. The script then checks if cookies saved as JSON objects for an older log-in exist, and if not logs in normally
3. Afterwards a connection with MongoDB is established, and the script finds the first 5 postings that haven't been tweeted
4. Using Selenium tweets are sent out over a 3 minute period, each with one of 8 template messages to publish new deals, and the posting date is saved in the database to not allow duplicate postings to occur
5. This script was turned into a CRON job using Windows Task Scheduler, and it runs automatically once a day to tweet out 5 deals daily

Demo:

  • To view the bot in action, click here: Demo

Libraries and Frameworks Used:

sahib's People

Contributors

mousazourob avatar

Watchers

 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.