How to find_elements with multiple attributes using cssSelector Python and Selenium

I'm trying to find all the elements that have <a href=....> inside the <div id="contents" ...>

Here is the HTML code:

<div id="contents" class="style-scope">
    <div id="dismissible" class="style-scope">
        <a id="thumbnail" href="http://www.test.com">

Here is my python code:

items = driver.find_elements(By.cssSelector("div[id="contents"] a[id="thumbnail"]"))

It gives me the error:

SyntaxError: invalid syntax. Perhaps you forgot a comma?

Where do I need to put the comma?



Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept