I have written like this
repos=driver.find_elements_by_xpath('//a[@class="execute repo-list--repo-name"]')
choice=input()
ch=repos[choice-1].text
print ch #prints choice1
driver.find_element_by_xpath('//a[contains(text(),"%s"]' % ch).click()
for the HTML code
<a class="execute repo-list--repo-name" href="/vivek-puri/choice1">choice1</a>
But it is showing the error
The given selector //a[contains(text(),"choice1"] is either invalid or does not result in a WebElement.
Why it is showing such error although the element with text choice1 exits.