- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to automate google Signup form in Selenium using Python?
We can automate Google Signup form with Selenium webdriver in Python. To automate this page, we have to first launch the Google Signup page and identify each element on the form.
Let us have a look at the Google Signup form −
Example
from selenium import webdriver #set chromodriver.exe path driver = webdriver.Chrome(executable_path="C:\chromedriver.exe") #implicit wait driver.implicitly_wait(0.5) #launch URL driver.get("https://accounts.google.com/signup") #identify elements within form f = driver.find_element_by_id("firstName") f.send_keys("Test") l = driver.find_element_by_id("lastName") l.send_keys("One") u = driver.find_element_by_id("username") u.send_keys("test124ewin") p = driver.find_element_by_name("Passwd") p.send_keys("test124@") c = driver.find_element_by_name ("ConfirmPasswd") c.send_keys("test124@") #get value entered s = f.get_attribute("value") t = l.get_attribute("value") v = u.get_attribute("value") w = p.get_attribute("value") print("Values entered in form: ") print(s) print(t) print(v) print(w) #submit form b = driver.find_element_by_class_name("VfPpkd-LgbsSe") b.click() #browser quit driver.quit()
Output
Advertisements
To Continue Learning Please Login
Login with Google