title: How to get text from anchor tag inside div using bs4
body: <p>I'm new to bs4 and I trying to extract text from anchor tag inside a div but it through me error.
  My code:
  from bs4 import BeautifulSoup</p>
  <pre><code>data = '''&lt;div class=&quot;one&quot;&gt;&lt;h2&gt;&lt;/h2&gt;&lt;/div&gt;
  &lt;div class=&quot;one&quot;&gt;&lt;h1&gt;Test 1&lt;/h1&gt;&lt;/div&gt;&lt;div class=&quot;one&quot;&gt;in &lt;a href=&quot;https://www.example.com&quot;&gt;Test Test&lt;/a&gt;&lt;/div&gt;
  &lt;div class=&quot;one&quot;&gt;&lt;h2&gt;&lt;/h2&gt;&lt;/div&gt;
  &lt;div class=&quot;two&quot;&gt;&lt;h2&gt;&lt;/h2&gt;&lt;/div&gt;'''
  
  soup = BeautifulSoup(data,'html.parser')
  
  for div in soup.findAll('div', attrs={'class':'one'}):
      ss = div.find('a')
      print(ss)
  </code></pre>
  <p>Given output:
  None
  None
  <a href="https://www.example.com" rel="nofollow noreferrer">Test Test</a>
  None</p>
  <p>Excepting output:
  Test Test</p>
  <p>How can I do that or is there any other method.</p>