title: Getting 'name' attributes with Beautiful Soup
body: <pre><code>from bs4 import BeautifulSoup
  
  source_code = """&lt;a href="#" name="One"&gt;&lt;/a&gt;
                   &lt;a href="#" name="Two"&gt;&lt;/a&gt;"""
  
  soup = BeautifulSoup(source_code)
  
  print soup.a['name']   #prints 'One'
  </code></pre>
  
  <p>Using BeautifulSoup, i can grab the first name attribute which is <code>one</code>, but i am not sure how i can print the second, which is <code>Two</code></p>
  
  <p>Anyone able to help me out?</p>