Note: Amazon changed the layout and IDs of their giftcard reload page, so this script is currently broken. Feel free to make an issue and/or fork the script if you want to make fixes yourself.
Python script to auto-buy Amazon giftcards
Based off of:
https://github.com/ageoldpun/amazon_gifts
http://pastebin.com/UW6eC3rn
- Selenium
- Chrome Webdriver (download)
Install Selenium using pip install selenium
Download the Chrome Webdriver and put it in a location of your choice
These are environment variables that you can define using whatever method works
best for you (export
in .bash_profile
, define in Python console or just
define in the script):
AMAZON_USERNAME
AMAZON_PASSWORD
CARD_NUMBERS
CHROME_DRIVER
You need your card numbers because Amazon will ask to confirm each one for the first iteration of a given card.
CHROME_DRIVER
is the location of your Chrome Webdriver (line 31).
Example: /Users/Spock/Downloads/webdrivers/chromedriver
These are arrays that correspond with the (0-indexed) list of cards on your Amazon Wallet page:
CARDS
ITERATIONS
In terminal, run python giftcards_galore.py
. Selenium will open a new Chrome
window and start the script.
For testing purposes, I recommend either starting with one iteration per card, or commenting out line 57.