I want to select all the divs which have BOTH A and B as class attributes.
The following selection
soup.findAll(\'div\', class_=[\'A\', \'B\'])
1 some tag like:
XXXX
if you want to use CSS selector to get the tag, you can write the code for the class attribute as following:
spans = beautifulsoup.select('span.A.B.C.D')
2 And if you want to use this for id attribute, you change as following:
XXXX
change the symbol you use in select function:
span = beautifulsoup.select('span#A')
What we learn is that its grammer is like the CSS3