How to select elements by class in XPath?

How to select elements by class in XPath?

You can select elements by class in XPath by using the contains(@class, "class-name") or @class="class-name" expressions.The first expression will match any element that contains class-name. Even if the element has additional…