find element beautifulsoup code example
Example 1: using bs4 to obtain html element by id
>>> import BeautifulSoup
>>> soup = BeautifulSoup.BeautifulSoup('<html><body><div id="articlebody"> ... </div></body></html')
>>> soup.find("div", {"id": "articlebody"})
<div id="articlebody"> ... </div>
Example 2: soup.find for class
mydivs = soup.findAll("div", {"class": "stylelistrow"})