-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroblos.py
91 lines (70 loc) · 2.51 KB
/
roblos.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import time
from colorama import init, Fore, Back, Style
init(convert=True)
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions import NoSuchElementException
options = Options()
options.add_argument('--headless')
options.add_argument('--disable-gpu') # Last I checked this was necessary.
options.add_argument("--log-level=3") # Fatal
try:
f = open('chromedriver.exe')
f.close()
except FileNotFoundError:
print('Chromedriver not found...')
time.sleep(5)
exit()
clear = str(input("Clear User List (Y/N)?: "))
startnum = int(input("Start ID: "))
maxnum = int(input("Max ID: "))
delay = float(input("Delay: "))
num = startnum or 1
if clear == "Y":
open("Users.txt", "w").close()
driver = webdriver.Chrome("chromedriver.exe", options=options)
with open('Users.txt', 'a+') as f:
valid = 0
deleted = 0
failed = 0
while num <= maxnum:
time.sleep(delay)
driver.get(f"https://www.roblox.com/users/{str(num)}/profile")
try:
name = driver.find_element_by_xpath('//*[@id="container-main"]/div[2]/div[2]/div/div[1]/div/div[2]/div[2]/div[1]/div[1]/h2').text
named = True
valid = valid + 1
print(
f"[{Fore.YELLOW}#{Fore.RESET}] {Fore.GREEN}{str(num)} = Success!{Fore.RESET}"
)
except NoSuchElementException:
try:
driver.find_element_by_xpath('//*[@id="container-main"]/div[2]/div/div/div[1]/h4')
named = False
deleted = deleted + 1
print(
f"[{Fore.YELLOW}#{Fore.RESET}] {Fore.YELLOW}{str(num)} = Deleted.{Fore.RESET}"
)
except NoSuchElementException:
named = False
failed = failed + 1
print(
f"[{Fore.YELLOW}#{Fore.RESET}] {Fore.RED}{str(num)} = Failed.{Fore.RESET}"
)
num = num + 1
if name and named: f.write(name + "\n")
f.flush()
print(
f"[{Fore.BLUE}#{Fore.RESET}] {Fore.CYAN}Valid - {str(valid)}{Fore.RESET}"
)
print(
f"[{Fore.BLUE}#{Fore.RESET}] {Fore.CYAN}Deleted - {str(deleted)}{Fore.RESET}"
)
print(
f"[{Fore.BLUE}#{Fore.RESET}] {Fore.CYAN}Failed - {str(failed)}{Fore.RESET}"
)
print(
f"[{Fore.BLUE}#{Fore.RESET}] {Fore.CYAN}Total - {str(valid + deleted + failed)}{Fore.RESET}"
)
driver.quit()