[feature] Parse JSON in www.coles.com.au pages
Version and OS v0.50.2 Docker
Is your feature request related to a problem? Please describe. Coles gives JSON for price data etc which CD completely ignores. This would be much better than trying to parse the HTML.
Describe the use-case and give concrete real-world examples https://www.coles.com.au/product/moccona-classic-dark-roast-instant-coffee-400g-6835015
I've seen my Coles price trackers, which used to work, are now showing an error in the UI of:
Cannot run, more than one price detected, this plugin is only for product pages with ONE product, try the content-change detection mode.
I don't know if it's because there's a "Customers also purchased" section at the bottom? I don't think that used to be there.
I'm also now running v0.50.2, though this has been broken for over a month. I'm not sure if the "break" correlates to any release of ChangeDetection, or if it was just a change on Coles' end that caused the problem.
Yeah - I don't think this is a CD change, but the Coles site. Mine broke quite a while back, but I didn't get around to checking them until recently. This was when I noticed the embedded JSON data.
{"@context":"https://schema.org","@type":"Product","@id":"https://www.coles.com.au/product/moccona-classic-dark-roast-instant-coffee-400g-6835015","image":"https://shop.coles.com.au/wcsstore/Coles-CAS/images/6/8/3/6835015.jpg","name":"Moccona Classic Dark Roast Instant Coffee | 400g","description":"The perfect coffee ..... to preserve the environment.","sku":6835015,"gtin":"8711000075333","brand":{"@type":"Brand","name":"Moccona"},"offers":[{"@type":"Offer","priceCurrency":"AUD","itemCondition":"https://schema.org/NewCondition","availability":"https://schema.org/InStock","url":"https://www.coles.com.au/product/moccona-classic-dark-roast-instant-coffee-400g-6835015","seller":{"@type":"Organization","name":"Coles"},"price":32.5,"potentialAction":{"@context":"https://schema.org","@type":"BuyAction"},"priceSpecification":{"@type":"UnitPriceSpecification","priceType":"https://schema.org/ListPrice","price":32.5,"priceCurrency":"AUD"}}]}
hmm only one product there
Looks fine here
My output for a number of products seems to be.... uncertain...
Could it be that for different areas, they have some different content? I know some have some 'related products' listed - but all have JSON present.
Well the link you supplied in the original issue works, now you give other links
can you try to be consistent? :)
I bet if you look at the HTML you will see it has multiple LD+JSON entries
I believe its Coles changing the site - as the ones that fail all fail at different times... Probably trying to sell more stuff via AI 'optimisation' ;)
The problem you two are debating, I think is nothing at all to do with the links used. I think it's caused by things that are on special. When a Coles product is NOT on special, the error does not occur. When a Coles product IS on special, the error occurs.
Which is why the link provided a week ago is no longer causing the issue. @dgtlmoon this is one of my links that is erroring right now, and should be up until Weds: https://www.coles.com.au/product/simson's-pantry-premium-mini-pizza-bases-garlic-and-herb-6-pack-240g-6576438
https://www.kiteworldshop.com/en/wing-surf-wings/8707-armstrong-a-wing-xps-wing.html#/4951-size-2_6m
Cannot run, more than one price detected, this plugin is only for product pages with ONE product, try the content-change detection mode.
the problem is not really a "problem", its that there is multiple prices available (maybe in the embedded data is the prices for S, M, L, XXL, XXXL, XXXXL, ladies, etc etc), so the system doesnt want to fill the screen with the varieties of sizes.. so its not sure what todo in this case, #3505 could be handy tho
When there are multiple products on a page, would it be possible to configure a specific product/variant to target?
I assume the schema varies across companies, but maybe we can show the JSON to the user have either have them select the field + value, or have them write a jq-like selector