title: Beautiful soup, html table parsing
body: <p>I am currently having a bit of an issue trying to parse a table into an array.</p>
  
  <p>I have a simple table (<a href="http://jsfiddle.net/575sW/" rel="nofollow" title="HERE">HERE</a>) which I need to parse with BS4 and put the cell contents into an array. What makes things difficult here is the fact that the cells don't contain text, but rather have images which have these titles:
  "Confirm" or "Site" - this is just user right's stuff.
  <strong>[I am skipping row one which contains the checkboxes, those i can extract without problems]</strong></p>
  
  <p>If you look at the fiddle above, all I need to do is to parse it in such a way that the resulting array becomes:</p>
  
  <pre><code>Array1[0] = User1,Confirm,Confirm,Site,Confirm
  Array1[1] = User2,Confirm,Confirm,Confirm,Confirm
  Array1[2] = User3,Confirm,Confirm,Confirm,Confirm
  Array1[3] = User4,Confirm,Site,Site,Confirm
  </code></pre>
  
  <p>Which I can then do as I please with.
  Another complication is that sometimes the number of rows will vary so the script should be able to adapt to this and recursively create the array from the table.</p>
  
  <p>At the moment StackOverflow is my only hope.. I have spent the last 10 hours doing this myself with little to no success and frankly I have lost hope. Closest I got to getting something out was extractin the  enclosed  tags, but could not parse further for some weird reason, perhaps it's bs4's nesting limitation? Could anyone have a look, please, and see if they can find a way of doing this? Or at least explain how to get there?</p>
  
  <p><strong>var explanations:
  rightml - the soup for the table.</strong></p>
  
  <pre><code>allusers = []
  rows = rightml.findAll('tr')
  for tr in rows:
      cols = tr.findAll('td')
      for td in cols:
          if (td.find(title="Group")) or (td.find(title="User")):
              text = ''.join(td.text.strip())
              allusers.append(text)
  print allusers
  
  gifrights = []
  
  rows7 = rightml.findAll('td')
  #print rows7
  for tr7 in rows:
      cols7 = tr7.findAll('img')
      for td7 in cols7:
          if (td7.find(title="Confirm")) or (td7.find(title="Site")):
              text = ''.join(td7.text.strip())
              text2 = text.split(' ')
              print text2
              gifrights.append(text2)
  </code></pre>
  
  <p>I could be WAY off with this code.. but I gave it the ol' college try.</p>