How can I select an image name which is defined in CSS?
I can select that CSS image class using JavaScript, but how can I get the image name inside that class? I want to to do it in Puppeteer/Node.js.
I want to click on this class given below if the image inside the class given below matches paper.gif
.
CLASS:
.height-20 span a {
background-image: url("paper.gif");
background-color: #cccccc;
}
SELECTOR:
let elements = document.querySelectorAll('.height-20 span a'); // Select all Products but how to get image inside this selector?
CLICKER:
await page.click(".height-20 span a");
What I want to achieve is given below:
if(css image == paper.gif) {
await page.click(".height-20 span a");
}