How do you getText from a tag in Selenium?

How do you getText from a tag in Selenium?

The getText() method of the Selenium WebDriver interface is used to retrieve the text for a specific web element. This method retrieves the web-visible element’s inner text (which is not obscured by CSS).