user3194722 user3194722 - 5 months ago 8x
Python Question

Selecting html element tag(?) name selenium python

I am writing a function in python3 using selenium that will click a link given that it matches a provided text, but having trouble figuring out how to do so. The html is as follows:

<a class="name-link" href="/colors/thisOne" </a>


I do know how to select the class name
but how would I also include the text
as an option as well, so that my if statement would be like:

if 'Yellow' == (variable):

Thank you in advance.

San San

Hope this one might help you solve the issue


Happy Coding :)