Geckodriver
, Selenium
, AND Firefox
as all versions of these will not play together nicely. More info here.You can pip install Selenium, BeautifulSoup, Urllib, PIL, PyTesseract, Lxml, and Requests using the command:
python -m pip install Selenium BeautifulSoup4 Urllib PIL Pytesseract Lxml Requests
Note: URLLib and PIL is standard in python 3.5+ and does not need to be aditionally installed.
PATH
of the variable profile to the path of the Firefox profile the you just created. profile = webdriver.FirefoxProfile('')
. This will allow you stay logged in to your Amazon account and run the program in headless mode. If you do not do this you will need to change the line options.headless = True
to options.headless = False
Simply run the script in and input the information requested. Then sit back and enjoy the winnings.
It will at first ask you some basic information regarding your amazon login information including your: email, password, and name. As well as some giveaway preferences such as entering into giveaways in which you must follow the sponsor to enter. None of your Amazon login information is saved anywhere and is used strictly to help the script log into your account
Next the script will parse through a list of thousands of current giveaways and compile them into a list to then be sorted. It will remove all previously entered giveaways using the entered_urls.txt list and then sort them by price in a descending order. If python fails to create the entered_urls.txt file then please create one in the same folder as everything else.
Then all the giveaways are collected and sorted the script will then use Selenium to open a Firefox browser window in headless mode (invisible browser) and log into your account if you did not create a Firefox profile or if it failed to locate it. From there it will identify what steps it must do to enter the giveaway, such as watching a video or clicking on the animated entry box. If a captcha test is identified the imagetester.py file while then use the Tesseract OCR to identify it and complete the test and continue.
Once the entry process is completed, it will check to see if you have won and if so will confirm your winnings. You should receive an email confirming your win within the same day.
When the individual prize process is complete the browser window will close, the giveaway url will be logged into entered_urls.txt and the browser window will be closed.
After all the current giveaways have been cycled through the script will automatically check again and if the minimum threshold number is met then it will start again, if not it will wait a set amount of time and check again later.