title: Extracting 'a' tags containing specific substring with Python's BeautifulSoup
body: <p>Using BeautifulSoup, I would like to return only "a" tags containing "Company" and not "Sector" in their href string. Is there a way to use regex inside of re.compile() to return only Companies and not Sectors?</p>
  
  <p>Code: </p>
  
  <p><code>soup = soup.findAll('tr')[5].findAll('a')
  print(soup)</code></p>
  
  <p>Output</p>
  
  <pre><code>[&lt;a class="example" href="../ref/index.htm"&gt;Example&lt;/a&gt;,  
  &lt;a href="?Company=FB"&gt;Facebook&lt;/a&gt;,  
  &lt;a href="?Company=XOM"&gt;Exxon&lt;/a&gt;,  
  &lt;a href="?Sector=5"&gt;Technology&lt;/a&gt;,  
  &lt;a href="?Sector=3"&gt;Oil &amp; Gas&lt;/a&gt;]  
  </code></pre>
  
  <p>Using this method: </p>
  
  <p><code>import re
  soup.findAll('a', re.compile("Company"))</code></p>
  
  <p>Returns: </p>
  
  <p><code>AttributeError: 'ResultSet' object has no attribute 'findAll'</code></p>
  
  <p>But I would like it to return (without the Sectors): </p>
  
  <p><code>[&lt;a href="?Company=FB"&gt;Facebook&lt;/a&gt;,<br>
  &lt;a href="?Company=XOM"&gt;Exxon&lt;/a&gt;]</code></p>
  
  <p>Using:</p>
  
  <ul>
  <li>Urllib.request version: 3.5 </li>
  <li>BeautifulSoup version: 4.4.1 </li>
  <li>Pandas version: 0.17.1</li>
  <li>Python 3  </li>
  </ul>