├── .github └── FUNDING.yml ├── README.md └── amazon-bot.py /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # amazon-python-bot 2 | Amazon Python bot to automatize the PS5 stock checking and bought in case of availability 3 | -------------------------------------------------------------------------------- /amazon-bot.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | from time import sleep 3 | 4 | class PS5Bot(): 5 | def __init__(self): 6 | self.driver = webdriver.Chrome() 7 | 8 | def login(self): 9 | self.driver.get('https://www.amazon.com') 10 | sleep(50) 11 | 12 | def checkAndBuyPS5(self): 13 | self.driver.get('THE SHIT YOU WANT TO BUY') 14 | sleep(1) 15 | try: 16 | buyNow = self.driver.find_element_by_xpath('//*[@id="add-to-cart-button"]') 17 | buyNow.click() 18 | sleep(2) 19 | buyNow2 = self.driver.find_element_by_xpath('//*[@id="hlb-ptc-btn"]') 20 | buyNow2.click() 21 | sleep(2) 22 | buyNow3 = self.driver.find_element_by_xpath('/html/body/div[5]/div/div[2]/form/div/div/div/div[2]/div/div[1]/div/div[1]/div/span/span/input') 23 | buyNow3.click() 24 | sleep(1) 25 | self.driver.close() 26 | except Exception as e: 27 | print(e) 28 | sleep(1.5) 29 | self.checkAndBuyPS5() 30 | bot = PS5Bot() 31 | bot.login() 32 | bot.checkAndBuyPS5() 33 | --------------------------------------------------------------------------------