Find a tag using text it contains using BeautifulSoup
问题 I am trying to webscrape some parts of this page: https://markets.businessinsider.com/stocks/bp-stock using BeautifulSoup to search for some text contained in h2 title of tables when i do: data_table = soup.find('h2', text=re.compile('RELATED STOCKS')).find_parent('div').find('table') It correctly get the table I am after. When I try to get the table "Analyst Opinion" using the similar line, it returns None: data_table = soup.find('h2', text=re.compile('ANALYST OPINIONS')).find_parent('div')