I am trying to scrape text in an H2 tag under a header which starts with "benefits of" ...so it could be like "benefits of toys" or "benefits of cups" etc.
The html code is:
<h2 class="DrugOverview__title___1OwgG">Benefits of Toys</h2>
The code I've used until now is
benfit = soup.find('h2',text='Benefits of')
q = benefit.get_text(strip=True)
How do I solve it? Also keep in mind the h2 class cant be used to scrape in this situation(due to other issues).