Category "css-selectors"

CSS - How can I divide a list <li> in 3 columns using li:nth-child?

There are 6 elements and I want them to be something like that: - First - Third - Fifth - Second - Fourth - Sixth I tried something like this:

Selenium ignore if element not present

I have the below code for my selenium, where I need to click on carousel icons and get all the images one by one, but sometimes that carousel doesn't have more

CSS select direct children, but not if inside another nested child

So, if this is the HTML of an element: <div class="parent"> <div class="ignore-me"> <p class="child">ignore me</p>

Adding HTML via JS to a specific child-Element

I have a very specific situation where I have ~50 child-divs which I cannot influence directly, that is, I cannot add classes or ids to one specific child-div n

How to toggle between two images on click without using JavaScript

In a HTML document, I have <img src="cat-thumbnail.jpg">. When the user clicks on the image, I want to display another image instead: <img src="cat-ful

Cannot scrape the correct aspect ration of the image - Python

I'm having a problem to extract an image from a "Manga" website using python. Below is the element example on the website: img id="comic" class="loading" onerro

How to click on a descendant li element with Selenium?

I am automating with selenium and reached a point where I click a drop down and there are 3 options and they are in a ul list, and each option is an li role. I

Differences between "Click Classes" and "Click Element" in Google Tag Manager

I don't really understand the differences between Click classes and Click Element in Google Tag Manager. I don't understand the expected use of these event and

How to apply the style only if next element has specific class?

Markup: <li class="divider"></li> <li class="active"><a href="#">Home</a> <li class="divider"></li> <li><a h

How to apply the style only if next element has specific class?

Markup: <li class="divider"></li> <li class="active"><a href="#">Home</a> <li class="divider"></li> <li><a h

What is the difference between the Descendant combinator and the subsequent sibling combinator? [duplicate]

To my knowledge, the descendant combinator (space) targets child and descendants of the parent element. the subsequent sibling combinator (~)

What is the difference between the Descendant combinator and the subsequent sibling combinator? [duplicate]

To my knowledge, the descendant combinator (space) targets child and descendants of the parent element. the subsequent sibling combinator (~)

Unable to locate the Sign In element within #shadow-root (open) using Selenium and Python

I'm trying to use selenium to automate some actions but am unable to find the first element on the page https://developer.servicenow.com/dev.do and so cannot lo

CSS - Is it possible to select multiple different child elements within a parent without repeating the parent?

I've been pawing over CSS selectors all afternoon in an attempt to find an answer to this because it seems so simple but I cannot for the life of me find any so

Finding all class names used in HTML/DOM

How can I get a list of all class names used inside an HTML Snippet? For example, the HTML Snippet below, <div class="name"> <div class="first">

Nesting CSS classes

Can I do something like the following? .class1{some stuff} .class2{class1;some more stuff}

CSS selector for first element with class

I have a bunch of elements with a class name red, but I can't seem to select the first element with the class="red" using the following CSS rule: .home .red

CSS selector for first element with class

I have a bunch of elements with a class name red, but I can't seem to select the first element with the class="red" using the following CSS rule: .home .red

CSS selector for first element with class

I have a bunch of elements with a class name red, but I can't seem to select the first element with the class="red" using the following CSS rule: .home .red