soup = BeautifulSoup('demo.html', 'html.parser')

soup.find_all('p', attrs={'class':'button', 'color':'black'}

若要找某个属性却不知道属性值的,则可以这样写

soup.find_all('p', attrs={'class':'button', 'color':'black', 'size':True}

posted on 2016-03-30 22:48  chimmu  阅读(218)  评论(0编辑  收藏  举报