-
Notifications
You must be signed in to change notification settings - Fork 0
/
MemberScraper.py
217 lines (181 loc) · 7.22 KB
/
MemberScraper.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
import csv
from bs4 import BeautifulSoup
import requests
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import pyautogui, sys
import time
from csv import writer
from itertools import zip_longest
with open('EndlessHacker Player List.csv', encoding='utf-8-sig') as csvfile:
reader = csv.reader(csvfile)
fsa = []
for row in reader:
# print(row[0])
fsa.append(row[0])
PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.implicitly_wait(10)
driver.get(fsa[1])
print(driver.title)
try:
username = WebDriverWait(driver,100).until(
EC.presence_of_element_located((By.XPATH, "//body/section[@id='login']/div[1]/div[1]/form[1]/input[2]"))
)
username.click()
username.send_keys("username")
except:
pass
try:
password = WebDriverWait(driver, 100).until(
EC.presence_of_element_located((By.XPATH, "//body/section[@id='login']/div[1]/div[1]/form[1]/input[3]"))
)
password.click()
password.send_keys("pass")
password.send_keys(Keys.RETURN)
except:
pass
x=158;
list = []
level = []
lonline =[]
NOVALUE = str("NaN")
while x < len(fsa):
try:
driver.get(fsa[x]);
x += 1
try:
captcha = WebDriverWait(driver, 1).until(
EC.presence_of_element_located((By.XPATH, "//div[@id='epicaptcha_message']"))
)
captcha = str(captcha.text)
print(captcha)
captxt = str('Move your mouse cursor through the bar above from left to right')
print(captxt)
try:
if captcha == captxt:
print("yesss")
x -= 1
# pyautogui.moveTo(1095,350)
# pyautogui.moveTo(1855, 350, 1)
# pyautogui.moveTo(1095, 400)
# pyautogui.moveTo(1855, 400, 1)
# pyautogui.moveTo(1095, 500)
# pyautogui.moveTo(1855, 500, 2.5)
pyautogui.moveTo(996, 280)
pyautogui.moveTo(1364, 280, 3)
pyautogui.moveTo(1019, 501)
pyautogui.moveTo(1858, 501, 3)
pyautogui.moveTo(1019, 589)
pyautogui.moveTo(1858, 589, 3)
# pyautogui.moveTo(1095, 550)
# pyautogui.moveTo(1855, 550, 2.5)
# pyautogui.moveTo(1095, 600)
# pyautogui.moveTo(1855, 600, 2.5)
# pyautogui.moveTo(1095, 650)
# pyautogui.moveTo(1855, 650, 2.5)
# pyautogui.moveTo(1095, 700)
# pyautogui.moveTo(1855, 700, 2.5)
# pyautogui.moveTo (1095,624,3)
submit = WebDriverWait(driver, 1).until(
EC.presence_of_element_located((By.XPATH, "//input[@id='epi']"))
)
submit.click()
# time.sleep(1)
except:
pass
except:
pass
try:
NaN = WebDriverWait(driver, 1).until(
EC.presence_of_element_located((By.XPATH, "//div[contains(text(),'Hacker not found.')]"))
)
NaNN = str(NaN.text)
print(NaNN)
NaNtxt = str('Hacker not found.')
print(NaNtxt)
try:
if NaNN == NaNtxt:
print("if nan == nantxt")
print(NaNN, "=", NaNtxt)
list.append(NaNN)
level.append(NOVALUE)
lonline.append(NOVALUE)
print(list)
print(level)
print(lonline)
data = [list, level, lonline]
export_data = zip_longest(*data, fillvalue='')
file = open('username data.csv', 'w', encoding="ISO-8859-1", newline='')
with file:
write = csv.writer(file)
write.writerows(export_data)
except:
pass
except:
pass
try:
excessively = WebDriverWait(driver, 1).until(
EC.presence_of_element_located((By.XPATH, "//div[contains(text(),'You are on a 5 minute captcha lockout for refreshi')]"))
)
excessivelyy = str(excessively.text)
excessivelytxt = str('You are on a 5 minute captcha lockout for refreshing the captcha excessively.')
try:
if excessivelyy == excessivelytxt:
x-=1
except:
pass
except:
pass
try:
disableacc = WebDriverWait(driver, 0).until(
EC.presence_of_element_located((By.XPATH, "//div[contains(text(),'You can not view profiles of disabled accounts.')]"))
)
disableaccc = str(disableacc.text)
disableacctxt = str('You can not view profiles of disabled accounts.')
try:
if disableaccc == disableacctxt:
print(disableaccc, '=', disableacctxt)
list.append(disableaccc)
level.append(NOVALUE)
lonline.append(NOVALUE)
print(list)
print(level)
print(lonline)
data = [list, level, lonline]
export_data = zip_longest(*data, fillvalue='')
file = open('username data.csv', 'w', encoding="ISO-8859-1", newline='')
with file:
write = csv.writer(file)
write.writerows(export_data)
except:
pass
except:
pass
name = WebDriverWait(driver, 1).until(
EC.presence_of_element_located((By.XPATH, "//body/section[@id='main-wrapper']/div[@id='main']/section[@id='content']/div[@id='profile']/div[@id='profile-wrapper']/h1[1]")))
levell = WebDriverWait(driver, 1).until(
EC.presence_of_element_located((By.XPATH, "//body/section[@id='main-wrapper']/div[@id='main']/section[@id='content']/div[@id='profile']/div[@id='profile-wrapper']/div[@id='profile-info']/div[3]/div[2]")))
lonlinee = WebDriverWait(driver, 1).until(
EC.presence_of_element_located((By.XPATH, "//body/section[@id='main-wrapper']/div[@id='main']/section[@id='content']/div[@id='profile']/div[@id='profile-wrapper']/div[@id='profile-info']/div[2]/div[3]")))
user = str(name.text)
levelll = str(levell.text)
lonlineee = str(lonlinee.text)
list.append(user)
level.append(levelll)
lonline.append(lonlineee)
print(list)
print(level)
print(lonline)
data = [list, level, lonline]
export_data = zip_longest(*data, fillvalue='')
file = open('username data.csv', 'w', encoding="ISO-8859-1", newline='')
with file:
write = csv.writer(file)
write.writerows(export_data)
except:
pass