Open In App
Related Articles

Sign in Geeksforgeeks using Python Selenium

Improve Article
Improve
Save Article
Save
Like Article
Like

Project Description:
Here, we’re going to study a simple how-to log in GFG by selenium. Selenium is a free tool for automated trying out across exceptional browsers. then a simple requirement id and password.

Requirements :

  • Selenium – Selenium Python Introduction and Installation
  • Steps to setup –

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

    • Then navigate the Password then copy the x_path.

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

    Implementation:




    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 user or mail id
    driver.find_element_by_xpath('//*[@id ="luser"]').send_keys('praveeny182')
      
    # find the element where we have to 
    # enter the xpath
    # fill password
    driver.find_element_by_xpath('//*[@id ="password"]').send_keys('xXXXXX')
      
    # find the element sign in 
    # request using xpath 
    # clicking on that element 
    driver.find_element_by_xpath('//*[@id ="Login"]/button').click()
          
        

    
    

    Output –
    You will eventually be logged in to geeksforgeeks in the browser where selenium is running.

    Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

    Last Updated : 04 Jan, 2021
    Like Article
    Save Article
    Previous
    Next
Similar Reads
Complete Tutorials