Quiz: CSS Selectors

Test your understanding of the concepts of CSS selectors.

1

Which pattern is used to get all the <a href="URL3"> elements in the given code snippet?

<div>
    <a href="URL1"></a>
    <ul>
        <li>
            <a href="URL2"></a>
        </li>
    </ul>
    <a href="URL3"></a>
</div>
A)

soup.select("div , a")

B)

soup.select("div + a")

C)

soup.select("ul + a")

D)

soup.select("div > a")

Question 1 of 40 attempted

Get hands-on with 1200+ tech skills courses.