title: Manipulating BeautifulSoup's ResultSet list object
body: <p>I am trying to extract 2 pieces of data: 1) The value of the option element's "value" attribute (ie "01000.html" below). 2) The string that is within the <code>&lt;option&gt;&lt;/option&gt;</code> tags (ie "Alabama").  There is limited information on the ResultSet list object that is created with I use </p>
  
  <p><code>url = 'http://quickfacts.census.gov/qfd/states/'
  page = urllib2.urlopen(url)
  soup = BeautifulSoup(page)
  state_list = soup.find_all("option")</code></p>
  
  <p>to extract the list of states from the US Census QFD page's drop-down menu (itself a  element with these options).</p>
  
  <p>Big picture, I was trying to loop through all the counties in the US using a simple i counter, but apparently the counties and States are not numbered uniformly.  I am therefore trying to build a list of these options in order to loop through the "value" (which becomes part of the URL) attributes for the "States (strings)". </p>
  
  <pre><code>state_list
  
  [&lt;option value="01000.html"&gt;Alabama&lt;/option&gt;,
   &lt;option value="02000.html"&gt;Alaska&lt;/option&gt;,
   &lt;option value="04000.html"&gt;Arizona&lt;/option&gt;,
   &lt;option value="05000.html"&gt;Arkansas&lt;/option&gt;,
   &lt;option value="06000.html"&gt;California&lt;/option&gt;,
   &lt;option value="08000.html"&gt;Colorado&lt;/option&gt;,
   &lt;option value="09000.html"&gt;Connecticut&lt;/option&gt;,
   &lt;option value="10000.html"&gt;Delaware&lt;/option&gt;,
   &lt;option value="11000.html"&gt;District of Columbia&lt;/option&gt;,
   &lt;option value="12000.html"&gt;Florida&lt;/option&gt;,
   &lt;option value="13000.html"&gt;Georgia&lt;/option&gt;,
   &lt;option value="15000.html"&gt;Hawaii&lt;/option&gt;,
   &lt;option value="16000.html"&gt;Idaho&lt;/option&gt;,
   &lt;option value="17000.html"&gt;Illinois&lt;/option&gt;,
   &lt;option value="18000.html"&gt;Indiana&lt;/option&gt;,
   &lt;option value="19000.html"&gt;Iowa&lt;/option&gt;,
   &lt;option value="20000.html"&gt;Kansas&lt;/option&gt;,
   &lt;option value="21000.html"&gt;Kentucky&lt;/option&gt;,
   &lt;option value="22000.html"&gt;Louisiana&lt;/option&gt;,
   &lt;option value="23000.html"&gt;Maine&lt;/option&gt;,
   &lt;option value="24000.html"&gt;Maryland&lt;/option&gt;,
   &lt;option value="25000.html"&gt;Massachusetts&lt;/option&gt;,
   &lt;option value="26000.html"&gt;Michigan&lt;/option&gt;,
   &lt;option value="27000.html"&gt;Minnesota&lt;/option&gt;,
   &lt;option value="28000.html"&gt;Mississippi&lt;/option&gt;,
   &lt;option value="29000.html"&gt;Missouri&lt;/option&gt;,
  
  (etc...)
  </code></pre>