Stuck with CSS selector

Hello,

I need your help re CSS selector.

I'm trying to capture stock information on a website I can't get my sitpemap working.

In the below example product is 'no longer stocked'

Here the product is in stock

All these information are part of div "tableinfo info-stock".
I'm mainly interested by the 'no longer stocked' information.

I tried a lot of things taking inspiration from:

such as div[class^="sales-status"] > div[class*='outofstock']:not(hidden)
to capture class 'outofstock' when not hidden, but I can get it working.

Preview always shows 'no longer stocked' even tho product is in stock.

Thank you.

David

Hi try this:

div[class$="hidden"] ~ div.inStockText

It should specifically detect the in stock condition and should return null if no stock

Hi,

My sitemap is still not working

{"_id":"distrelec_test","startUrl":["https://www.distrelec.biz/en/oscilloscope-2x-100mhz-4gsps-keysight-dsox3012a/p/17623260?q=*&pos=30&origPos=30&origPageSize=100"],"selectors":[{"id":"status","type":"SelectorElement","parentSelectors":["_root"],"selector":"div[class$="hidden"] ~ div.inStockText","multiple":false,"delay":0}]}

preview always displays 'null'

Tried: div[class*="40-45"] preview shows: Only available while stocks last No longer stocked
the 2 possible values

Tried div[class*="40-45"] > div[class*="hidden"] preview shows Only available while stocks last
that's correct as it is the hidden class.

Tried div[class*="40-45"] > div[class*=:not("hidden")] to get the class that is not hidden but it doesn't work.

I want to see 'No longer stocked' if the products is no longer stocked and 'NULL' in all the other cases.

Thank you

Hi,

I finally found how to select the div that doesn't contain the word 'hidden'
div[class*='41-45'] ~ div:not([class*='hidden'])

Works fine for what I want to achieve.

David