title: How to access multiple attributes of a tag using BeautifulSoup?
body: <p>Say I have a HTML Tag <code>&lt;span id=&quot;sample&quot; value=&quot;type-2&quot; data-type=&quot;haulted&quot; encryption_stat=&quot;False&quot;&gt;&lt;/span&gt;</code></p>
  <p>I want to access values of its all attributes without using loops and list comprehension approach and I have a list of attributes to access <code>['data-type','encryption-stat','value']</code> of the span tag.</p>
  <p>So basically I dont want to try this:</p>
  <pre class="lang-py prettyprint-override"><code>from bs4 import BeautifulSoup
  s = '&lt;span id=&quot;sample&quot; value=&quot;type-2&quot; data-type=&quot;haulted&quot; encryption_stat=&quot;false&quot;&gt;&lt;/span&gt;'
  data = BeautifulSoup(s,'html.parser')
  values = []
  for i in ['data-type','encryption_stat','value']:
      values.append(data.find('span',id='sample').get(i))
  </code></pre>
  <p>Neither the list comprehension hack.</p>
  <p>Is there anyway to achieve the objective?</p>