Prices coming as Null

I am trying to scrape process from a section of a website initially but the price is being loaded dynamically and returning Null into the data. How do I get the price selector to return the price correctly?

Url: https://www.selcobw.com/products/insulation/cavity-insulation
Sitemap:
{"_id":"test-selco","startUrl":["https://www.selcobw.com/products/insulation/cavity-insulation"],"selectors":[{"id":"item code","type":"SelectorText","parentSelectors":["product"],"selector":".product-summary p","multiple":false,"regex":"","delay":0},{"id":"short desc","type":"SelectorText","parentSelectors":["product"],"selector":"h1","multiple":false,"regex":"","delay":0},{"id":"price","type":"SelectorText","parentSelectors":["product"],"selector":"#price-excluding-tax-6896 span.price","multiple":false,"regex":"","delay":0},{"id":"product","type":"SelectorLink","parentSelectors":["_root"],"selector":".title a","multiple":true,"delay":0}]}

Yea, this one is slightly tricky. Your current price selector is too specific and would only work for one product (the number is unique). I have changed it to a more generic selector and used a Regex to match the price without "Ex Vat". The Regex is £[\d\.\,]{1,12}\b which will match prices up to 999999999.99 or 9,999,999.99 (if commas are used)

{"_id":"test-selco-v2","startUrl":["https://www.selcobw.com/products/insulation/cavity-insulation"],"selectors":[{"id":"item code","type":"SelectorText","parentSelectors":["product"],"selector":".product-summary p","multiple":false,"regex":"","delay":0},{"id":"short desc","type":"SelectorText","parentSelectors":["product"],"selector":"h1","multiple":false,"regex":"","delay":0},{"id":"price","type":"SelectorText","parentSelectors":["product"],"selector":"div.price-box span:nth-of-type(1)","multiple":false,"regex":"£[\\d\\.\\,]{1,12}\\b","delay":0},{"id":"product","type":"SelectorLink","parentSelectors":["_root"],"selector":".title a","multiple":true,"delay":0}]}

Thanks that work great

Is there a specific reason why you opted not to use a simple ".price-excluding-tax .price" selector?

Or if there only would be the id available, you can use * with the selector "span[id*="price-excluding-tax"] .price" to serve as a wildcard selector.

Using the "nth-of-type" selector usually is a bit of a gamble, especially when paired with a rogue regex

Hi yes, that should work. Am still learning about CSS and selectors as I am not a web developer. Thanks for the info!