views:

33

answers:

1

I can traverse generic tags easily with BS, but I don't know how to find specific tags. For example, how can I find all occurances of <div style="width=300px;">? Is this possible with BS?

+1  A: 

The following should work

soup = BeautifulSoup(htmlstring)
soup.findAll('div', style="width=300px;")

There are couple of ways to search for tags.

For more text to understand and use it

pyfunc