Beautiful Soup findAll
Find all element by class or other parameters in Beautiful Soup
Here are a couple of ways to search the soup for certain tags, or tags with certain properties:
titleTag = soup.html.head.title titleTag #
titleTag.string # u'Page title' len(soup('p')) # 2 soup.findAll('p', align="center") # [
This is paragraph one. ] soup.find('p', align="center") #
This is paragraph one. soup('p', align="center")[0]['id'] # u'firstpara' soup.find('p', align=re.compile('^b.*'))['id'] # u'secondpara' soup.find('p').b.string # u'one' soup('p')[1].b.string # u'two'
Source : BeautifulSoup