Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
debaet
GitHub Repository: debaet/IXLMultiBot
Path: blob/main/main.py
111 views
1
from selenium import webdriver
2
import os, time
3
from selenium.webdriver.common.keys import Keys
4
from selenium.webdriver.chrome.options import Options
5
from selenium.common.exceptions import NoSuchElementException
6
from selenium.webdriver.common.action_chains import ActionChains
7
import sys
8
import colorama
9
from colorama import Fore, Back, Style
10
colorama.init()
11
12
# config
13
14
# change the directory to your chrome driver. for more instructions read the readme file.os
15
PATH = ('C:\\Program Files (x86)\\Chrome\\Application\\chromedriver.exe')
16
17
18
driver = webdriver.Chrome(PATH)
19
20
21
def main4(argv):
22
lesson = input('Enter lesson link for algerba')
23
while True:
24
driver.get(lesson)
25
time.sleep(4)
26
driver.refresh()
27
time.sleep(4)
28
q1 = driver.find_element_by_class_name('yui3-practiceagent-content')
29
q2 = q1.text
30
print(repr(q2))
31
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[1]/div/div[2]/button').click()
32
time.sleep(4)
33
driver.find_element_by_xpath('/html/body/div[1]/div/div/div[2]/div[2]/div/div/div[2]/div[2]/div/button[2]').click()
34
time.sleep(4)
35
#change this
36
answer = driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[4]/div[2]/div/div/div[2]')
37
ans = answer.text
38
print(ans)
39
driver.delete_all_cookies()
40
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[1]/div[2]/button').click()
41
42
43
def main1(argv):
44
lesson = input('Enter an 8th grade lesson link')
45
while True:
46
driver.get(lesson)
47
time.sleep(4)
48
driver.refresh()
49
time.sleep(4)
50
q1 = driver.find_element_by_class_name('yui3-practiceagent-content')
51
q2 = q1.text
52
print(repr(q2))
53
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[1]/div/div[2]/button').click()
54
time.sleep(4)
55
driver.find_element_by_xpath('/html/body/div[1]/div/div/div[2]/div[2]/div/div/div[2]/div[2]/div/button[2]').click()
56
time.sleep(4)
57
#change this
58
answer = driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[4]/div[2]/div/div/div/div/div[9]')
59
ans = answer.text
60
print(ans)
61
driver.delete_all_cookies()
62
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[1]/div[2]/button').click()
63
64
65
66
def main2(argv):
67
lesson = input('Please Enter A 7th Grade Lesson Link: ')
68
while True:
69
driver.get(lesson)
70
time.sleep(4)
71
driver.refresh()
72
time.sleep(4)
73
q1 = driver.find_element_by_class_name('yui3-practiceagent-content')
74
q2 = q1.text
75
print(repr(q2))
76
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[1]/div/div[2]/button').click()
77
time.sleep(4)
78
driver.find_element_by_xpath('/html/body/div[1]/div/div/div[2]/div[2]/div/div/div[2]/div[2]/div/button[2]').click()
79
time.sleep(4)
80
answer = driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[4]/div[2]/div/div/div/div/div')
81
ans = answer.text
82
print(ans)
83
driver.delete_all_cookies()
84
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[1]/div[2]/button').click()
85
# 6th Grade
86
def main3(argv):
87
lesson = input('Please Enter A 6th Grade Lesson Link: ')
88
while True:
89
driver.get(lesson)
90
time.sleep(4)
91
driver.refresh()
92
time.sleep(4)
93
q1 = driver.find_element_by_class_name('yui3-practiceagent-content')
94
q2 = q1.text
95
print(repr(q2))
96
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[1]/div/div[2]/button').click()
97
time.sleep(4)
98
driver.find_element_by_xpath('/html/body/div[1]/div/div/div[2]/div[2]/div/div/div[2]/div[2]/div/button[2]').click()
99
time.sleep(4)
100
answer = driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[4]/div[2]/div/div/div/div')
101
ans = answer.text
102
print(ans)
103
driver.delete_all_cookies()
104
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[1]/div[2]/button').click()
105
106
107
108
109
def op1():
110
os.system('cls' if os.name == 'nt' else 'clear')
111
print('If any of these are incorrect, bot will fail.')
112
username = input('Enter Username or Email: ')
113
password = input('Enter Password: ')
114
os.system('cls' if os.name == 'nt' else 'clear')
115
116
117
print('do not touch the window that has just popped up. ')
118
print('smart score goes up and down alot, just go afk or do something in background!')
119
driver.get('https://www.ixl.com/math/grade-7/add-and-subtract-integers')
120
time.sleep(3)
121
driver.refresh()
122
driver.find_element_by_xpath('//*[@id="qlusername"]').send_keys(username)
123
driver.find_element_by_xpath('//*[@id="qlpassword"]').send_keys(password)
124
driver.find_element_by_xpath('//*[@id="qlsubmit"]').click()
125
driver.execute_script('''window.open('',"_blank");''')
126
driver.switch_to.window(driver.window_handles[-1])
127
driver.get('https://www.meta-calculator.com/scientific-calculator.php?panel-203-simple-calculator')
128
driver.switch_to.window(driver.window_handles[0])
129
130
while True:
131
time.sleep(3)
132
variable = driver.find_element_by_class_name('old-space-indent').text
133
print(variable)
134
driver.switch_to.window(driver.window_handles[-1])
135
box = driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/div[1]/div[2]/div[2]/div[4]/div[1]/div[2]/input')
136
time.sleep(3)
137
driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/div[1]/div[2]/div[2]/div[4]/div[1]/div[2]/input').send_keys(variable)
138
139
answer = driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/div[1]/div[2]/div[2]/div[4]/div[1]/div[2]/input')
140
box.send_keys(Keys.BACKSPACE)
141
print('the bot will now pause for 150 seconds to generate some time.')
142
time.sleep(150)
143
box.send_keys(Keys.ENTER)
144
answer = driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/div[1]/div[2]/div[2]/div[4]/div[1]/div[1]/span[2]').text
145
a = (answer)
146
c = "="
147
148
for char in c:
149
a = a.replace(char, "")
150
151
print(a)
152
driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/div[1]/div[2]/div[2]/div[4]/div[1]/div[2]/button[2]').click()
153
driver.switch_to.window(driver.window_handles[0])
154
driver.find_element_by_class_name('fillIn').click()
155
driver.find_element_by_class_name('fillIn').send_keys(a)
156
time.sleep(3)
157
driver.find_element_by_class_name('fillIn').send_keys(Keys.ENTER)
158
driver.refresh()
159
160
161
162
163
def op2():
164
os.system('cls' if os.name == 'nt' else 'clear')
165
grade = input('Are you in 8th Grade? (Y/N): ')
166
if grade == "Y":
167
main1(sys.argv)
168
print('You are In 8th Grade')
169
print('You will be asked to Enter Your Lesson Link')
170
else:
171
grade2 = input('Are you in 7th Grade? (Y/N): ')
172
if grade2 == "Y":
173
main2(sys.argv)
174
print('You are In 7th Grade')
175
print('You will be asked to Enter Your Lesson Link')
176
177
else:
178
grade3 = input('Are you in 6th Grade? (Y/N): ')
179
if grade3 == "Y":
180
print('You are In 6th Grade')
181
print('You will be asked to Enter Your Lesson Link')
182
main3(sys.argv)
183
else:
184
print('algerba')
185
main4(sys.argv)
186
187
188
189
190
def op4():
191
os.system('cls' if os.name == 'nt' else 'clear')
192
print('If any of these are incorrect, bot will fail.')
193
username = input('Enter Username or Email: ')
194
password = input('Enter Password: ')
195
os.system('cls' if os.name == 'nt' else 'clear')
196
197
198
199
def op5():
200
os.system('cls' if os.name == 'nt' else 'clear')
201
print('If any of these are incorrect, bot will fail.')
202
username = input('Enter Username or Email: ')
203
password = input('Enter Password: ')
204
os.system('cls' if os.name == 'nt' else 'clear')
205
206
207
208
def main():
209
print('Menu: ')
210
print('1. Add more time to your account')
211
print('2. Scrape Answers (get answers)')
212
print('3. Get Teacher Accounts')
213
print('4. Auto Answer (some lessons work)')
214
print('5. Credits')
215
var = input('Enter an Option: ')
216
217
# goes to the specified option
218
if var==('1'):
219
op1()
220
221
elif var==('2'):
222
op2()
223
224
elif var==('3'):
225
op3()
226
elif var==('4'):
227
op4()
228
229
elif var==('5'):
230
op5()
231
232
else:
233
print('Please enter numbers only. If you did and still got an error, please enter a number which is listed above.')
234
time.sleep(4)
235
os.system('cls' if os.name == 'nt' else 'clear')
236
main()
237
238
239
240
# end code
241
242
print('Welcome to The First Functional IXL BOT.')
243
print('DO NOT CLOSE THE CHROME WINDOW THAT IS ABOUT TO POP UP.')
244
print('Please wait..')
245
246
time.sleep(3)
247
os.system('cls' if os.name == 'nt' else 'clear')
248
main()
249
250
251