title: How to find all <li>'s within a specific <ul> class?
body: <p><strong>Environment:</strong></p>
  
  <p>Beautiful Soup 4</p>
  
  <p>Python 2.7.5</p>
  
  <p><strong>Logic:</strong></p>
  
  <p>'find_all' <code>&lt;li&gt;</code> instances that are within a <code>&lt;ul&gt;</code> with a class of <code>my_class</code> eg:</p>
  
  <pre><code>&lt;ul class='my_class'&gt;
  &lt;li&gt;thing one&lt;/li&gt;
  &lt;li&gt;thing two&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Clarification:  Just get the 'text' between the <code>&lt;li&gt;</code> tags.  </p>
  
  <p><strong>Python Code:</strong></p>
  
  <p>(The find_all below is not correct, I am just putting it in context)</p>
  
  <pre><code>from bs4 import BeautifulSoup, Comment
  import re
  
  # open original file
  fo = open('file.php', 'r')
  # convert to string
  fo_string = fo.read()
  # close original file
  fo.close()
  # create beautiful soup object from fo_string
  bs_fo_string = BeautifulSoup(fo_string, "lxml")
  # get rid of html comments
  my_comments = bs_fo_string.findAll(text=lambda text:isinstance(text, Comment))
  [my_comment.extract() for my_comment in my_comments]
  
  my_li_list = bs_fo_string.find_all('ul', 'my_class')
  
  print my_li_list
  </code></pre>