How do I getText from an element?
The getText() method returns the text of a visible element and its sub-elements. It disregards the leading and trailing spaces. To get the text content of an element, we must first identify it using one of the locators such as id, class, name, XPath, or CSS, and then apply the getText() method to it.
You can learn more around how to get text of an element in Selenium.