Multiple CSS class search is unhandy
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Beautiful Soup |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Just discovered BS does not fully support searching for multiple CSS classes.
The quote from docs (http://
>> searching for variants of the string value won’t work:
css_soup.
# []
To search html for more than one css class you need to do loops or build sophisticated regex.
Could you fix this behavior and make search for string "class1 class2" match tags containing BOTH of these classes or create another handy routine?
Searching css_soup.
The BeautifulSoup version is 4.1.3
Python 2.7.3
html5lib, lxml are not installed
description: | updated |
description: | updated |
You can use a CSS selector to search for a tag that matches several CSS classes. I've added this fact to the "searching bs CSS class" section of the documentation. This lets me resolve the issue without writing new code.