blob: 94d3ae2bafcf961bfb42d8548f9c65c9a3095779 (
plain) (
blame)
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
29
30
|
import time
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.ui import WebDriverWait
driver = webdriver.Chrome("C:/chromedriver.exe");
xPath = """//*[@id="app-mount"]/div[1]/div/div[2]/div/section/div/div[1]"""
count = 0
might = 0
attempts = 0
codes = ["code1", "code2", "code3"] # this is where you put the requested paths, perameters, values, etc.
for code in codes:
print(attempts)
attempts += 1
driver.get("http://discord.gift/" + code) # this is where you put the hostname of which you are checking the ^
time.sleep(5)
try:
texter = driver.find_element_by_xpath(xPath)
except NoSuchElementException:
print ("Might work \n \n \n \n %s - By fruitberries/ Zoltan - \n \n \n \n" % code)
might += 1
continue
if(texter.text == "Gift Code Invalid"):
print("WORKING: %d | ATTEMPTS: %d | Might work: %d" % (count, attempts, might))
else:
print ("It worked \n \n \n \n %s - fruitberries/ Zoltan - \n \n \n \n" % code)
count += 1
time.sleep(3);
print("Done with: \n\tWorking: %d \n\tAttempts: %d \n\t Might: %d" % (count, attempts, might))
driver.close()
|