BeautifulSoup 根据文本内容反查标签

 pattern = re.compile("test")
 element = soup_object.find('a', text=pattern).parent

 http://stackoverflow.com/questions/866000/using-beautifulsoup-to-find-a-html-tag-that-contains-certain-text

原文地址:https://www.cnblogs.com/yaoshi/p/5434993.html