title: BeautifulSoup: TypeError: 'NoneType' object is not subscriptable
body: <p>I need  take <strong>"href"</strong> attribute from a link (<strong>a</strong>) tag.</p>
  
  <p>I run </p>
  
  <pre><code> label_tag = row.find(class_='Label')
   print(label_tag)
  </code></pre>
  
  <p>and I get (sorry, I can't show link and text for privacy reasons)</p>
  
  <pre><code>&lt;a class="Label" href="_link_"&gt;_text_&lt;/a&gt;
  </code></pre>
  
  <p>of <strong>type</strong></p>
  
  <pre><code>&lt;class 'bs4.element.Tag'&gt;
  </code></pre>
  
  <p>but when I run (as shown at <a href="https://stackoverflow.com/questions/5815747/beautifulsoup-getting-href">BeautifulSoup getting href</a> )</p>
  
  <pre><code>tag_link = label_tag['href']
  print(tag_link)
  </code></pre>
  
  <p>I guess the following error (on first command)</p>
  
  <pre><code>TypeError: 'NoneType' object is not subscriptable
  </code></pre>
  
  <p>Any clue?
  Thanks in advance</p>
  
  <p><strong>[SOLVED] EDIT</strong>: I was making a mistake (looping over elements with heterogeneous structure)</p>