select() incorrectly splits some selectors

Bug #1724378 reported by Kerry Kurian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Beautiful Soup
New
Undecided
Unassigned

Bug Description

element.py:

1345 def select(self, selector, _candidate_generator=None, limit=None):
1346 """Perform a CSS selection operation on the current element."""
1347
1348 # Handle grouping selectors if ',' exists, ie: p,a
1349 if ',' in selector:
1350 context = []
1351 for partial_selector in selector.split(','):

The selector is split on comma irrespective of whether the comma is in quotes. This is problematic when the selector is something like the following:

    a[title="Houston, we have problem"]

In this example the selector is erroneously split into:

    'a[title="Houston'

and:

    ' we have problem"]'

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.