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>
Yellow
I do know how to select the class name "find_element_by_class_name("name-link") but how would I also include the text Yellow as an option as well, so that my if statement would be like:
if 'Yellow' == (variable):
.click()
Thank you in advance.