alexschimpf / Snkrs-Bot

Selenium bot for Nike Snkrs site
The Unlicense
850 stars 290 forks source link

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 6 selenium drivers in the bin directory for both Chrome and Firefox on Linux, MacOS, and Winows. The drivers for other operating systems need to be installed from the instructions below. 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.

Getting started

There are a few requirements to run the bot. First, you'll need to install Python 3.7 or greater. The instructions below show you how to do this in several operating systems

Next, we have provided the web drivers for MacOS, Linux, and Windows, but if they're not there, or you want something more up-to-date than the included drivers, you'll need to download them yourself with the instructions below

Finally, the program is run from the terminal (command line), so you should familiarize yourself with running python programs from the terminal here

Downloading python

This needs to be Python version 3.7 or up

MacOS

Linux

Windows

  1. The selenium webdrivers for your chosen browser

Installing the web drivers

Usage

  1. Make sure that you have done all the Pre-installation requirements in the Getting Started section above

  2. Clone this repository's source code

    1. If you have git installed, this can be done as easily as git clone https://github.com/alexschimpf/Snkrs-Bot
    2. Otherwise, download the zipped source code and unzip it
  3. Navigate to the project's code

    • cd path/to/downloaded/project
  4. Install all the Python dependencies by running

    • pip install -r requirements.txt
  5. Run the bot

    • Replace all the fields in the command below with the options that you want, and any of the configuration options listed below
      python3 main.py --username myemail@gmail.com --password abc123 --url <your-shoes-url> --shoe-size 6 --driver-type chrome

Configuration options

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

--username

--password

--url

--shoe-size

--shoe-type

--cvv

--shipping-option

--shipping-address

--login-time

--release-time

--screenshot-path

--html-path

--page-load-timeout

--driver-type

--webdriver-path

--headless

--select-payment

--purchase

--num-retries

--dont-quit