Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Sign in using Selenium in Python

  • Last Updated : 04 Jan, 2021

In this article, we’re going to study a simple how-to log in by selenium. Selenium is a free tool for automated trying out across exceptional browsers.


 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course

  • You need to install chromedriver and set path. Click here to download.
  • Selenium is a powerful tool for controlling web browsers through programs and performing browser automation. It is functional for all browsers, works on all major OS and its scripts are written in various languages i.e Python, Java, C#, etc, we will be working with Python.

Below are the steps:

  • First, go to the website.
  • Then click on investigate element by urgent ctrl + shift + i or stepping into setting of browser and clicking on investigate detail manually.
  • Then navigate the box where email is filled then copy the x_path.

  • Then navigate the next button and copy the x_path.

  • Then navigate the Password then copy the x_path.

  • Then navigate the Sign-in button then copy the x_path.

Below is the implementation:


# import required modules
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
# create instance of Chrome webdriver
driver = webdriver.Chrome()
# find the element where we have to
# enter the xpath
# fill the  email
# click on next button
# find the element where we have to
# enter the xpath
# fill the password
# find the element Sign in
# request using xpath
# clicking on that element


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!