python search text in beautifulsoup code example Example: beautifulsoup find by text soup.find_all("a", string="Elsie") # [Elsie]