im trying to write a code to automatically create a gmail using selenium. the item im trying to find is the firstname input in the url below:
i used wait but it returns a TimeoutException error. also, say i want to use implicit wait, how can i do that?
thanks
class BotCreator:
def __init__(self, firstname, lastname):
self.firstname = firstname
self.lastname = lastname
self.driver = webdriver.Firefox(executable_path=r'A:\Python Projects\The InstaBOT/geckodriver')
def shutdown(self):
self.driver.close
def gmail_creator(self, n_bots):
for n in range(n_bots):
global email
email = {}
driver = self.driver
wait = WebDriverWait(driver, 10)
driver.get('https://www.google.com/intl/en-GB/gmail/about/')
driver.find_element_by_xpath('//a[@title="Create an account"]').click()
wait.until(ec.new_window_is_opened(driver.window_handles))
after = driver.window_handles[1]
driver.switch_to.window(after)
element = wait.until(ec.element_to_be_clickable((By.XPATH, '//input[@id="firstName"]')))
element.send_keys('awsd')
return email
gmail_t = BotCreator('John', 'Hoffinsky')
gmail_t.gmail_creator(1)
