How to get title of a webpage using Selenium in Python? Improve Improve Like Article Like Save Share Report The title method is used to retrieve the title of the webpage the user is currently working on. It gives the title of the current webpage loaded by the driver in selenium, if webpage has no title a null string will be returned. Webpage title :A page title, also known as a title tag, is a short description of a webpage and appears at the top of a browser window and in SERPs. It is an important element of an optimized SEO page. A page title should include a page’s keyword in the title tag. Syntax : driver.title Argument : It takes no argument. Return value : It return the title of webpage in string format. Code 1: # importing webdriver from selenium from selenium import webdriver # Here Chrome will be used driver = webdriver.Chrome() # URL of website url = "https://www.geeksforgeeks.org/" # Opening the website driver.get(url) # Getting current URL source code get_title = driver.title # Printing the title of this URL print(get_title) Output : GeeksforGeeks | A computer science portal for geeks Code 2: # importing webdriver from selenium from selenium import webdriver # Here Chrome will be used driver = webdriver.Chrome() # URL of website url = "https://www.google.com/" # Getting current URL source code get_title = driver.title # Printing the title of this URL # Here it is null string print(get_title, " ", len(get_title)) # Opening the website driver.get(url) # Getting current URL source code get_title = driver.title # Printing the title of this URL print(get_title, " ", len(get_title)) Output : Google Last Updated : 04 Jan, 2021 Like Article Save Article Previous Selenium Base Mini Project Using Python Next Find the OR and AND of Array elements using JavaScript Share your thoughts in the comments Add Your Comment Please Login to comment... Similar Reads Extract title from a webpage using Python Count total number of Links In Webpage Using Selenium In Python How to click a button on webpage using selenium ? Interacting with Webpage - Selenium Python How to add Site Header, Site Title, Index Title in a Django Project? How to change the WooCommerce shop page title to custom title ? title driver method - Selenium Python GUI to get views, likes, and title of a YouTube video using YouTube API in Python How to Clone webpage Using pywebcopy in Python? Extract all the URLs from the webpage Using Python Like R rakshitarora Follow Article Tags : Python Selenium-Exercises Python-selenium Python Web Technologies Practice Tags : python