Giter Site home page Giter Site logo

snkrs-bot's Introduction

PLEASE READ!

This is a Selenium bot for buying a given sneaker from the Nike Snkrs website ON RELEASE DAY. It will not work for sneakers that are past their release day (or later in the release day). Please note that this script was written with the US site in mind, so Nike sites for other countries will likely cause problems. This is because the purchase page changes to where the buy button redirects to a seperate checkout page (as opposed to a direct buy popup during release). It is a commandline script written solely in python. Please run with python 3.7. There are 4 selenium drivers in the bin directory for both Chrome and Firefox on both Linux and MacOS. I have not added the drivers for Windows. I have found the Firefox driver for MacOS works best.

Ideally, some pieces (or all?) of this could be replaced with direct Nike API requests instead of Selenium. However, I've found that Nike APIs are not very straightforward.

Before running, make sure to install the requirements by running: pip install -r requirements.txt

Here is a list and description of the different arguments to use for the script:

--username

  • Username for login

--password

  • Password for login

--url

  • URL for desired shoe

--shoe-size

  • Self-explanatory (NOTE: this can fail if both women and men sizes are available)

--login-time

  • If given, the bot will pause until a specific time before it logs in (can be any datetime format)

--release-time

  • If given, the bot will pause until a specific time before it purchase the sneaker (can be any datetime format)

--screenshot-path

  • If given, the bot will take a screenshot of the page after purchasing and save it at the given file path (may be useful for debugging)

--html-path

  • If given, the bot will take the page source after purchasing and save it at the given file path (may be useful for debugging)

--page-load-timeout

  • This is used to limit the page load time (in seconds), which can be useful when the page is still loading, but the UI is nevertheless useable. This is pretty much a necessity as I've noticed Nike's pages hang all the time. I'd recommend using 1-3 seconds for this.

--driver-type

  • Should be 'firefox' or 'chrome' (the OS will be determined for you)

--headless

  • This will run the driver in headless mode, which should make the bot quicker

--select-payment

  • If you already have your payment options pre-saved on your Nike account, DO NOT use this. If for some reason you don't have it pre-saved (even though it will cost the bot more time) the bot will select the first payment option it finds.

--purchase

  • If this argument is given, the bot WILL attempt to purchase the shoe so USE WITH CAUTION!

--num-retries

  • If the bot fails for some reason, it will retry any number of times or until successful

snkrs-bot's People

Contributors

alexschimpf avatar

Watchers

James Cloos avatar

Forkers

maxgratton

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.