title: Python HTML parsing with beautiful soup and filtering stop words
body: <p>I am parsing out specific information from a website into a file. Right now the program I have looks at a webpage, and find the right HTML tag and parses out the right contents. Now I want to further filter these "results". </p>
  
  <p>For example, on the site : <a href="http://allrecipes.com/Recipe/Slow-Cooker-Pork-Chops-II/Detail.aspx" rel="nofollow">http://allrecipes.com/Recipe/Slow-Cooker-Pork-Chops-II/Detail.aspx</a></p>
  
  <p>I am parsing out the ingredients which are located in &lt; div class="ingredients"...> tag. This parser does the job nicely but I want to further process these results. </p>
  
  <p>When I run this parser, it removes numbers, symbols, commas, and slash(\ or /) but leaves all text. When I run it on the website I get results like: </p>
  
  <pre><code>cup olive oil
  cup chicken broth
  cloves garlic minced
  tablespoon paprika
  </code></pre>
  
  <p>Now I want to further process this by removing stop words like "cup", "cloves", "minced", "tablesoon" among others. How exactly do I do this? This code is written in python and I am not very good at it, and I am just using this parser to get information which I can manually enter but I would rather not. </p>
  
  <p>Any help on how to do this in detail would be appreciated! My code is below: how would  I do this?</p>
  
  <p>Code: </p>
  
  <pre><code>import urllib2
  import BeautifulSoup
  
  def main():
      url = "http://allrecipes.com/Recipe/Slow-Cooker-Pork-Chops-II/Detail.aspx"
      data = urllib2.urlopen(url).read()
      bs = BeautifulSoup.BeautifulSoup(data)
  
      ingreds = bs.find('div', {'class': 'ingredients'})
      ingreds = [s.getText().strip('123456789.,/\ ') for s in ingreds.findAll('li')]
  
      fname = 'PorkRecipe.txt'
      with open(fname, 'w') as outf:
          outf.write('\n'.join(ingreds))
  
  if __name__=="__main__":
      main()
  </code></pre>