I'm trying to make the script for uploading the files from my local disk to google drive using selenium. I am success upto successful login and clicking new button on google drive desktop version but after that I am not able to select option that appears under new small window ( window that appears after 'new' button is pressed )
My code till now:
#!/usr/bin/python
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
browser=webdriver.Firefox()
#gdURL='https://drive.google.com'
gdURL='https://accounts.google.com/ServiceLogin?service=wise&passive=true& continue=http%3A%2F%2Fdrive.google.com%2F%3Futm_source%3Den_US& utm_medium=button&utm_campaign=web&utm_content=gotodrive&usp=gtd<mpl=drive'
browser.get(gdURL)
def idIn(email):
gId=browser.find_element_by_id('identifierId')
gId.send_keys(email)
gId.send_keys(Keys.ENTER)
time.sleep( 10 )
def passIn(passwd):
gPass=browser.find_element_by_name('password')
gPass.send_keys(passwd)
gPass.send_keys(Keys.ENTER)
time.sleep( 30 )
if browser.find_element_by_id('identifierId'):
idIn('myemail')
passIn('mypassword')
#if browser.find_element_by_name('password'):
# passIn('mypassword')
btn=browser.find_elements_by_tag_name('button')
btn[4].click()