title: Python Selenium save list items as array
body: <p>I am using Python Selenium to look through some HTML and find elements.  I have the following HTML saved into Python...</p>
  
  <pre><code>&lt;section id="categories"&gt;
      &lt;ul id="category_list"&gt;
          &lt;li id="category84"&gt;
              &lt;a href="www.example.com/samplelink"&gt;Sample Category&lt;/a&gt;
          &lt;/li&gt;
          &lt;li id="category984"&gt;
              &lt;a href="www.example.com/samplelink44"&gt;Another Category&lt;/a&gt;
          &lt;/li&gt;
          &lt;li id="category22"&gt;
              &lt;a href="www.example.com/samplelink"&gt;My Sample Category&lt;/a&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>I can find the categories section easy enough but now I would like to loop through each list item and save it's name and href link into an array.</p>
  
  <p>Anyone got a similar example I can see?</p>