Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import gspread
- from oauth2client.service_account import ServiceAccountCredentials
- from selenium import webdriver
- from selenium.webdriver.common.keys import Keys
- import pyperclip
- link = ''
- def scribbl(name):
- scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
- credentials = ServiceAccountCredentials.from_json_keyfile_name('scribble-e5ac7b0aa632.json', scope)
- gc = gspread.authorize(credentials)
- sheet = gc.open('scribble').sheet1
- sheetList = []
- for i in sheet.get_all_values():
- sheetList.extend(i)
- comma = ','.join(sheetList)
- chromedriver = r'C:\Users\Rishi\Documents\PATH\chromedriver'
- driver = webdriver.Chrome(chromedriver)
- driver.get('http://skribbl.io')
- nameBox = driver.find_element_by_id('inputName') # Find the search box
- nameBox.send_keys(name)
- createBox = driver.find_element_by_id('buttonLoginCreatePrivate')
- createBox.click()
- customBox = driver.find_element_by_id('lobbySetCustomWords')
- driver.implicitly_wait(3)
- customBox.send_keys(comma)
- linkBox = driver.find_element_by_id('inviteCopyButton')
- linkBox.click()
- link = pyperclip.paste()
- driver.implicitly_wait(20)
- driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement