├── .idea
├── .gitignore
├── ConsoleBot.iml
├── inspectionProfiles
│ └── profiles_settings.xml
├── misc.xml
└── modules.xml
├── README.md
├── configs
├── consoles.conf
├── credentials.conf
└── drivers
│ ├── chromedriver_win32.zip
│ └── chromedriver_win32
│ └── chromedriver.exe
├── requirements.txt
└── src
├── __init__.py
└── consoles.py
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/.idea/ConsoleBot.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ConsoleBot v0.01
2 | Python bot for purchasing consoles (ps5 or xbox series x).
3 |
4 | # Credentials
5 | Update configs/credentials.conf with your username and password
6 |
7 | # Execute ConsoleBot
8 | python3 src/consoles.py
9 |
--------------------------------------------------------------------------------
/configs/consoles.conf:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/configs/credentials.conf:
--------------------------------------------------------------------------------
1 | [creds]
2 | username = changeme@mail.com
3 | pw = changeme
4 | [site]
5 | wm = www.walmart.com
6 |
7 | [email]
--------------------------------------------------------------------------------
/configs/drivers/chromedriver_win32.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/casetech/ConsoleBot/3a99bbdaa2778e773572accbc778153b73691f18/configs/drivers/chromedriver_win32.zip
--------------------------------------------------------------------------------
/configs/drivers/chromedriver_win32/chromedriver.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/casetech/ConsoleBot/3a99bbdaa2778e773572accbc778153b73691f18/configs/drivers/chromedriver_win32/chromedriver.exe
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | asn1crypto==0.24.0
2 | backports-abc==0.5
3 | certifi==2018.8.24
4 | chardet==3.0.4
5 | configparser==3.5.0b2
6 | cryptography==2.6.1
7 | dnf==0.0.1
8 | entrypoints==0.3
9 | enum34==1.1.6
10 | futures==3.3.0
11 | idna==2.6
12 | ipaddress==1.0.17
13 | Jinja2==2.11.2
14 | keyring==17.1.1
15 | keyrings.alt==3.1.1
16 | MarkupSafe==1.1.1
17 | msgpack==0.6.2
18 | pycrypto==2.6.1
19 | PyGObject==3.30.4
20 | pyOpenSSL==19.0.0
21 | python-apt==1.8.4.1
22 | pyxdg==0.25
23 | PyYAML==5.3.1
24 | pyzmq==19.0.1
25 | requests==2.21.0
26 | salt==3000.3
27 | salt-ssh==3000.3
28 | SecretStorage==2.3.1
29 | singledispatch==3.4.0.3
30 | six==1.12.0
31 | urllib3==1.24.1
32 | vboxapi==1.0
33 |
--------------------------------------------------------------------------------
/src/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/casetech/ConsoleBot/3a99bbdaa2778e773572accbc778153b73691f18/src/__init__.py
--------------------------------------------------------------------------------
/src/consoles.py:
--------------------------------------------------------------------------------
1 | import configparser
2 | #from selenium import webdriver
3 | from time import sleep
4 | from webbot import Browser
5 |
6 | consoles = {
7 | "ps5": "https://www.walmart.com/ip/PlayStation-5-Console/363472942",
8 | "ps5_digital": "https://www.walmart.com/ip/Sony-PlayStation-5-Digital-Edition/493824815",
9 | "xbox": "https://www.walmart.com/ip/XB1-Xbox-Series-X/443574645"
10 | }
11 |
12 | retailers = {
13 | "wm_home": "https://www.walmart.com/",
14 | }
15 |
16 | class WMProcess():
17 | """
18 | Walmart login credentials/process
19 | """
20 | def __init__(self):
21 | config = configparser.ConfigParser()
22 | config.read("../configs/credentials.conf")
23 | #setup login and site information
24 | self.username = config['creds']['username']
25 | self.pw = config['creds']['pw']
26 | self.site = retailers['wm_home']
27 | self.ps5 = consoles['ps5']
28 | self.ps5_digital = consoles['ps5_digital']
29 | self.xbox = consoles['xbox']
30 | self.web = Browser()
31 |
32 | def open_browser(self):
33 | #gc = webdriver.Chrome(r"../configs/drivers/chromedriver_win32/chromedriver.exe")
34 | #gc.get(self.site)
35 | self.web.go_to(self.site)
36 | sleep(2)
37 |
38 |
39 | def login(self):
40 | self.web.click('Account')
41 | self.web.click('Sign In')
42 | self.web.type(self.username, into='email')
43 | self.web.type(self.pw, into='password')
44 | self.web.click('Sign In')
45 | #change this line below for ps5, ps5_base, or xbox
46 | self.web.go_to(self.ps5)
47 |
48 | def add_to_cart(self):
49 | self.web.click('Add to cart')
50 |
51 | def checkout(self):
52 | self.web.click('Check out')
53 |
54 | def delivery(self):
55 | self.web.click('Continue')
56 | sleep(1)
57 |
58 |
59 | def confirm_address(self):
60 | self.web.click('Continue')
61 |
62 | def select_payment(self):
63 | self.web.click('Continue')
64 |
65 | def review_order(self):
66 | self.web.click('Review your order')
67 |
68 | def place_order(self):
69 | self.web.click('Place order')
70 |
71 | def main(self):
72 | self.open_browser()
73 |
74 |
75 | if __name__ == '__main__':
76 | get_console = WMProcess()
77 | get_console.open_browser()
78 | get_console.login()
79 | get_console.add_to_cart()
80 | get_console.checkout()
81 | get_console.delivery()
82 | get_console.confirm_address()
83 | get_console.select_payment()
84 | get_console.review_order()
85 | get_console.place_order
86 | sleep(10)
--------------------------------------------------------------------------------