user3194722 user3194722 - 1 year ago 50
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
Answer Source

Hope this one might help you solve the issue


Happy Coding :)