Note that you can also use regular expressions to search in attributes of tags. For example:
import re
from bs4 import BeautifulSoup
soup.find_all('a', {'href': re.compile(r'crummy\.com/')})
This example finds all <a> tags that link to a website containing the substring 'crummy.com'.