Using selector with multiword attribute value throws exception
Bug #1692137 reported by
Thomas Hauk
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Beautiful Soup |
Fix Released
|
Low
|
Unassigned |
Bug Description
The following call will throw an exception
optgroup = soup.select_
as the recurisve call
tokens = shlex.split(
Will eventually result in a token list of `optgroup[
Seems to me this is because the quotation marks are scrubbed out by shlex on the first call to it.
description: | updated |
description: | updated |
tags: | added: css |
Changed in beautifulsoup: | |
importance: | Undecided → Low |
To post a comment you must log in.
I've confirmed this bug with the following code:
from bs4 import BeautifulSoup id">).select_ one('#some_ id > optgroup[ label=" Some Label"]')
BeautifulSoup("<a id="some_
Since the CSS selector system is contributed code, I only add to it when a patch and test are contributed. I'm going to leave this issue open in a 'confirmed' state and if someone provides a patch or pull request I'll merge it.