You can use the find_all() function to find all "a" tags on a webpage. To find a particular string inside the "a" tag, you need to use the argument "string."
Here is an example. I am searching for "tom" inside the "a" tag.
from bs4 import BeautifulSoup
import urllib.request as ur
url = "url_of_the_webpage"
req = ur.Request(url, None, headers={'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36' })
rs = ur.urlopen(req)
soup = BeautifulSoup(rs, 'html.parser')
for sp in soup.find_all("a", string="tom"):
print(sp.text)