-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscalper.py
28 lines (19 loc) · 1.07 KB
/
scalper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Firefox()
driver.get("https://www.anhoch.com/product/599870452/gigabyte-geforce-rtx-3080-gaming-oc-10gb-gddr6x-2xhdmi3xdp-dx12u-rgb-windforce-3x")
addToCartButton = driver.find_element_by_class_name("add-to-cart")
foundButton = False
while not foundButton:
if("disabled" in addToCartButton.get_attribute("class")):
time.sleep(10)
driver.get("https://www.anhoch.com/product/599870452/gigabyte-geforce-rtx-3080-gaming-oc-10gb-gddr6x-2xhdmi3xdp-dx12u-rgb-windforce-3x")
addToCartButton = driver.find_element_by_class_name("add-to-cart")
else:
foundButton=True
addToCartButton.click()
#https://www.anhoch.com/product/599867068/speaker-marshall-stockwell-ii-bluetooth-black
#https://www.anhoch.com/product/599870452/gigabyte-geforce-rtx-3080-gaming-oc-10gb-gddr6x-2xhdmi3xdp-dx12u-rgb-windforce-3x