title: How to convert an HTML table into a Python dictionary
body: <p>I have the following HTML excerpt in a format of a Python list that I'd like to turn into a dictionary. It is a timetable for everyday of the week.</p>
  
  <pre><code>[u'
  &lt;table class="hours table"&gt;\n
      &lt;tbody&gt;\n
          &lt;tr&gt;\n
              &lt;th scope="row"&gt;Mon&lt;/th&gt;\n
              &lt;td&gt;\n &lt;span class="nowrap"&gt;2:00 pm&lt;/span&gt; - &lt;span class="nowrap"&gt;3:00 pm&lt;/span&gt;
                  &lt;br&gt;&lt;span class="nowrap"&gt;5:00 pm&lt;/span&gt; - &lt;span class="nowrap"&gt;10:00 pm&lt;/span&gt;\n &lt;/td&gt;\n
              &lt;td class="extra"&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n\n
          &lt;tr&gt;\n
              &lt;th scope="row"&gt;Tue&lt;/th&gt;\n
              &lt;td&gt;\n &lt;span class="nowrap"&gt;2:00 pm&lt;/span&gt; - &lt;span class="nowrap"&gt;3:00 pm&lt;/span&gt;
                  &lt;br&gt;&lt;span class="nowrap"&gt;5:00 pm&lt;/span&gt; - &lt;span class="nowrap"&gt;10:00 pm&lt;/span&gt;\n &lt;/td&gt;\n
              &lt;td class="extra"&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n\n
          &lt;tr&gt;\n
              &lt;th scope="row"&gt;Wed&lt;/th&gt;\n
              &lt;td&gt;\n &lt;span class="nowrap"&gt;2:00 pm&lt;/span&gt; - &lt;span class="nowrap"&gt;3:00 pm&lt;/span&gt;
                  &lt;br&gt;&lt;span class="nowrap"&gt;5:00 pm&lt;/span&gt; - &lt;span class="nowrap"&gt;10:00 pm&lt;/span&gt;\n &lt;/td&gt;\n
              &lt;td class="extra"&gt;\n &lt;span class="nowrap open"&gt;Open now&lt;/span&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n\n
          &lt;tr&gt;\n
              &lt;th scope="row"&gt;Thu&lt;/th&gt;\n
              &lt;td&gt;\n &lt;span class="nowrap"&gt;2:00 pm&lt;/span&gt; - &lt;span class="nowrap"&gt;3:00 pm&lt;/span&gt;
                  &lt;br&gt;&lt;span class="nowrap"&gt;5:00 pm&lt;/span&gt; - &lt;span class="nowrap"&gt;10:00 pm&lt;/span&gt;\n &lt;/td&gt;\n
              &lt;td class="extra"&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n\n
          &lt;tr&gt;\n
              &lt;th scope="row"&gt;Fri&lt;/th&gt;\n
              &lt;td&gt;\n &lt;span class="nowrap"&gt;2:00 pm&lt;/span&gt; - &lt;span class="nowrap"&gt;3:00 pm&lt;/span&gt;
                  &lt;br&gt;&lt;span class="nowrap"&gt;5:00 pm&lt;/span&gt; - &lt;span class="nowrap"&gt;10:00 pm&lt;/span&gt;\n &lt;/td&gt;\n
              &lt;td class="extra"&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n\n
          &lt;tr&gt;\n
              &lt;th scope="row"&gt;Sat&lt;/th&gt;\n
              &lt;td&gt;\n &lt;span class="nowrap"&gt;5:00 pm&lt;/span&gt; - &lt;span class="nowrap"&gt;10:00 pm&lt;/span&gt;\n &lt;/td&gt;\n
              &lt;td class="extra"&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n\n
          &lt;tr&gt;\n
              &lt;th scope="row"&gt;Sun&lt;/th&gt;\n
              &lt;td&gt;\n Closed\n &lt;/td&gt;\n
              &lt;td class="extra"&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;/tbody&gt;\n &lt;/table&gt;']
  </code></pre>
  
  <p>The wishful output is:</p>
  
  <pre><code>{
  'Mon': ['2:00pm - 3:00pm', '5:00pm - 10:00pm'], 
  'Tue': ['2:00pm - 3:00pm', '5:00pm - 10:00pm'], 
  'Wed': ['2:00pm - 3:00pm', '5:00pm - 10:00pm'], 
  'Thu': ['2:00pm - 3:00pm', '5:00pm - 10:00pm'], 
  'Fri': ['2:00pm - 3:00pm', '5:00pm - 10:00pm'], 
  'Sat': '5:00pm - 10:00pm', 
  'Sun': 'Closed'
  }
  </code></pre>
  
  <p>How would you achieve this in Python 3.x? I would not mind if the 'Sat' and 'Sun' keys have values in a list format if that'd help at all. Thank you for your thoughts in advance.</p>