Advertisement
Ihsirletap

Untitled

Apr 18th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. import gspread
  2. from oauth2client.service_account import ServiceAccountCredentials
  3. from selenium import webdriver
  4. from selenium.webdriver.common.keys import Keys
  5. import pyperclip
  6.  
  7.  
  8. link = ''
  9.  
  10. def scribbl(name):
  11. scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
  12. credentials = ServiceAccountCredentials.from_json_keyfile_name('scribble-e5ac7b0aa632.json', scope)
  13.  
  14. gc = gspread.authorize(credentials)
  15. sheet = gc.open('scribble').sheet1
  16.  
  17. sheetList = []
  18. for i in sheet.get_all_values():
  19. sheetList.extend(i)
  20. comma = ','.join(sheetList)
  21.  
  22. chromedriver = r'C:\Users\Rishi\Documents\PATH\chromedriver'
  23.  
  24. driver = webdriver.Chrome(chromedriver)
  25. driver.get('http://skribbl.io')
  26.  
  27.  
  28.  
  29.  
  30. nameBox = driver.find_element_by_id('inputName') # Find the search box
  31. nameBox.send_keys(name)
  32.  
  33.  
  34.  
  35.  
  36. createBox = driver.find_element_by_id('buttonLoginCreatePrivate')
  37. createBox.click()
  38.  
  39. customBox = driver.find_element_by_id('lobbySetCustomWords')
  40. driver.implicitly_wait(3)
  41. customBox.send_keys(comma)
  42.  
  43. linkBox = driver.find_element_by_id('inviteCopyButton')
  44. linkBox.click()
  45. link = pyperclip.paste()
  46.  
  47. driver.implicitly_wait(20)
  48. driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement