re.compile and array class filters don't work on multiple class names

Bug #1476868 reported by Brandon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Beautiful Soup
Fix Released
Undecided
Unassigned

Bug Description

Undecided whether this is actually by design or a bug, however per this StackOverflow question, it needs clarification: http://stackoverflow.com/a/31551429/1214800

In short, given this code:

```
from bs4 import BeautifulSoup
import re
soup = BeautifulSoup("<html><div class='l5 center'>l5test</div><div class='l4 center'>l4test</div><div class='l6 center'>l6test</div>")

results1 = soup.findAll('div', re.compile(r'l4 center'));
print results1
results2 = soup.findAll('div', ['l4 center']);
print results2
results3 = soup.findAll('div', 'l4 center');
print results3
```

Only results3 gives a result. Shouldn't the other two return the same result?

Revision history for this message
Leonard Richardson (leonardr) wrote :

Yes, they should. This is fixed in revision 417.

Changed in beautifulsoup:
status: New → Fix Committed
Changed in beautifulsoup:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.