title: Python 3 - Get text from tag in beautifulSoup
body: <p>I am using beautifulSoup to extract data from website. Text from that website changes everytime you reload your page so basically I wish to be able to set a focus on the class name as a Static variable since the text is Dynamic. </p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  url = 'xxxxxxxxxxx'
  r = requests.get(url)
  soup = BeautifulSoup(r.content, 'html.parser')
  class2 = soup.find_all(True, class_="template_title")
  print (class2)
  </code></pre>
  
  <p>which prints out<br>
  <code>&lt;td align="left" class="template_title" height="50" valign="bottom" width="535"&gt;&lt;div style="padding-bottom:9px;"&gt;4&lt;/div&gt;&lt;/td&gt;</code><br>
  When the page reloads, I will still have the focus on the area but I do not know how to print only the text (which in this case is : 4) </p>
  
  <p>Once this is figured out, I have another question: If the class contains multiple tags, is there a way to get more static data to be sure it only prints the text I was searching for and not more? ( I have class, but could I use height="50" valign="bottom" width="535" as well?)</p>