forked from Juksern/esportal-name-finder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_ownInput.py
44 lines (35 loc) · 1013 Bytes
/
check_ownInput.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
import os
from selenium import webdriver
# Globals
options = webdriver.ChromeOptions()
options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors"])
options.add_argument('headless')
options.add_argument('window-size=0x0')
path = os.path.dirname(os.path.abspath(__file__))
print(path)
driver = webdriver.Chrome(path + '/chromedriver.exe', options=options)
base_url = 'https://beta.esportal.se/profile/'
url_path = path + '/list.txt'
id = ''
# Opens url
def scan(id):
driver.get(base_url + id)
# Writes to output
def write_file(id):
f = open(path + '/output.txt', 'a+')
f.write(id)
f.close()
def split_nickname(input, nickname):
words = input.split(",")
for i in words:
scan(i)
if driver.title == 'Home - Esportal':
print('free: ' + i)
i = i + "\n"
write_file(i)
else:
print('used: ' + i)
return nickname
nickname = ""
input = input("Insert Nickname: ")
split_nickname(input, nickname)