1

I am successfully opening a url using selenium and python. Above the address bar in the browser there is a tab that gets opened, I am trying to get the name that tab displays. For e.g. I opened the url - https://8.8.8.8 After it is opened, tab name appears as Google.

I am trying to fetch the name of the tab i.e google.

1

1 Answer 1

8

Simply call driver.title. See below:

from selenium import webdriver
d = webdriver.Chrome()
d.get('https://python.org')
d.title
# 'Welcome to Python.org'
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.