Login Twitter using Python Selenium Last Updated : 04 Jan, 2021 Improve Improve Like Article Like Save Share Report Project Description:- Here, we’re going to study a simple how-to log in twitter by selenium. Selenium is a free tool for automated trying out across exceptional browsers. Requirement: Selenium – Selenium Python Introduction and Installation Below are the steps: First, go to the twitter 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 Phone, email, or username are filled then copy the x_path. Then navigate the Password then copy the x_path. Then navigate the Login button then copy the x_path. Below is the implementation: One can replace the username and password for the account to be successfully logged in. Here the code is for demonstration only. from selenium import webdriver from selenium.webdriver.common.keys import Keys import time # create instance of Chrome webdriver driver = webdriver.Chrome() driver.get("https://twitter.com/login") # find the element where we have to # enter the xpath # fill the number or mail driver.find_element_by_xpath('//*[@id ="react-root"]/div/div/div[2]/main/div/div/div[1]/form/div/div[1]/label/div/div[2]/div/input').send_keys('XXXXXX0418') # find the element where we have to # enter the xpath # fill the password driver.find_element_by_xpath('//*[@id ="react-root"]/div/div/div[2]/main/div/div/div[1]/form/div/div[2]/label/div/div[2]/div/input').send_keys('PrXXXXXXXXX9') # find the element log in # request using xpath # clicking on that element driver.find_element_by_xpath('//*[@id ="react-root"]/div/div/div[2]/main/div/div/div[1]/form/div/div[3]/div/div').click() Output – You will be logged in to twitter in the browser selenium has opened automatically. Like Article Suggest improvement Next Twitter Automation using Selenium Python Share your thoughts in the comments Add Your Comment Please Login to comment... Similar Reads Twitter Automation using Selenium Python Gmail Login using Python Selenium How to access popup login window in selenium using Python How to Build a Twitter Bot to Post Latest Stock Update using Python Twitter Sentiment Analysis on Russia-Ukraine War Using Python Twitter Sentiment Analysis using Python twitter-text-python (ttp) module - Python Twitter Sentiment Analysis WebApp Using Flask How to make a Twitter Bot in Python? Create MySQL Database Login Page in Python using Tkinter Like praveeny182 Follow Article Tags : Python Selenium-Exercises Python-selenium Computer Subject Python Practice Tags : python