title: Getting ALL attributes from an IWebElement with Selenium WebDriver
body: <p>I want to extract some information from the DOM with Selenium. I'm using the C# WebDriver.</p>
  
  <p>Looking at the IWebElement interface you can easily extract a given attribute. However, I would like to extract all the attributes of an element without knowing their names in before hand.</p>
  
  <p>There must be some simple way of doing this since there is a method for getting an attribute value if you know its name.</p>
  
  <p>An example:</p>
  
  <pre><code>&lt;button id="myButton" ng-click="blabla()" ng-show="showMyButton" 
       some-other-attribute="foo.bar" /&gt;
  
  
  
  IWebElement element = driver.FindElement(By.Id("myButton"));
  Dictionary&lt;string, string&gt; attributes = new Dictionary&lt;string, string&gt;();
  // ???????
  // Profit.
  </code></pre>
  
  <p>Hopefully I'm missing something obvious.</p>
  
  <p>Thanks in advance!</p>