title: Removing attributes with colons with BeautifulSoup Python
body: <p>I sometimes run into html with has weird attributes, like for example <strong>fb:share:layout</strong>.</p>
  
  <pre><code>&lt;a class="addthis_button_facebook_share" fb:share:layout="button_count" style="height:20px;"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>Im not entirely sure what they are called (itemscopes? namespaces?).</p>
  
  <p>Currently I parse HTML with beautifulsoup4 in python. Im wondering if there is a way to remove or rename all attributes that contain these colons.</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT:</strong>
  Thanks for the answer. I ended up implementing it like this:</p>
  
  <pre><code>    for tag in soup.find_all(True):
              attrs = dict(tag.attrs)
              for attr in attrs:
                  if ":" in attr:
                      del tag.attrs[attr]
  </code></pre>