Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import unittest
- from selenium import *
- from selenium.webdriver.chrome.service import Service
- from selenium.webdriver.common.keys import Keys
- import random
- import string
- from selenium.webdriver.support.ui import WebDriverWait
- from selenium.webdriver.support import expected_conditions as EC
- from selenium.webdriver.common.by import By
- from selenium.common.exceptions import TimeoutException
- from selenium.webdriver.chrome.options import Options
- from selenium import webdriver
- options = Options()
- options.headless = False
- delay = 10 # seconds
- rdname = ('').join(random.choices(string.ascii_letters + string.digits, k=8))
- join = int(input("How many bots would you like: "))
- x = input("What is the game Id?: ")
- driver = webdriver.Chrome("chromedriver.exe", options=options)
- def bot():
- driver.get('http://www.kahoot.it')
- elem = WebDriverWait(driver, delay).until(EC.presence_of_element_located((By.ID, 'game-input')))
- time.sleep(.1)
- elem.clear() #Clears any entered text.
- elem.send_keys(x) #Types out game id
- elem.send_keys(Keys.RETURN) #Hits the Enter key
- myElem = WebDriverWait(driver, delay).until(EC.presence_of_element_located((By.ID, 'nickname')))
- myElem.send_keys(rdname)
- myElem.send_keys(Keys.RETURN)
- try:
- if join > 100:
- print("Error: This exceeds the max bot limit of 100.")
- else:
- while join > 0:
- print(join)
- bot()
- print("Bot Joined")
- join -= 1
- else:
- print("Bot Flooding is finished")
- except:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement