I have Googled this many times and am unable to figure this out. I have the following code and am trying to pull the element based on either the specific string or a piece of the string. The id and data-id can change so those are not usable. I have tried lots of variations of the same thing but continue to get the str object is not callable.
driver.find_element(By.XPATH, '//a[contains(("This is my text (Make a selection)")]')
driver.find_element(By.XPATH, "//a[contains(text(), 'Make a selection')]")
HTML:
<li id="li_L2_SR_6">
<input name="intent1" type=
"radio" data-id="L2_SR_6">
"This is my text (Make a selection)"
</li>