title: How to get meaningful content using BeautifulSoup in python
body: <p>I have some code to extract body from a webpage like this:-</p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  content=requests.get('https://www.someurl.com')
  soup=BeautifulSoup(content.content, 'html.parser')
  bodyContent=soup.select('body')[0].getText()
  print(bodyContent)
  </code></pre>
  
  <p>This code works well. But if body is something like that:-</p>
  
  <pre><code>&lt;script&gt;var x='something'; //and much more stuffs&lt;/script&gt;&lt;h1&gt;Body of the webpage&lt;/h1&gt;
  </code></pre>
  
  <p>Then the result is:-</p>
  
  <pre><code>var x='something'; //and much more stuffs Body of the webpage
  </code></pre>
  
  <p>I want to only get content inside <strong>div</strong>, <strong>span</strong>, <strong>p</strong> and all other <strong>meaningful</strong> content. I want to ignore script tag and any code related tag.
  What's the solution for it?</p>