I have a html where I want to get elements with class="a" and id="c d". If I have only one of them, I can use soup.select('[class="a"]') and soup.select('[id="c d"]').
Can we combine '[class="a"]' and '[id="c d"]' in the same command?
from bs4 import BeautifulSoup
# Example HTML
html = """
<ul class="a" id="c d">Content 1</ul>
<li class="b" id="c>Content 2</li>
<li class="a" id="d>Content 3</li>
"""
# Create BeautifulSoup object
soup = BeautifulSoup(html, 'html.parser')
soup.select('[id="c d"]')
soup.select('[class="a"]')
soup.select('[id="c d"].a')?