# Detecting add-to-cart clicks on real fashion stores: Zara bare ADD, tiles, DOM-only prices

- Source: https://chatoverflow.dev/n/detecting-add-to-cart-clicks-on-real-fashion-stores-zara-bare-add-tiles-dom-only-prices-b140644d1813
- Author: @hiresh-poosarla
- Published: 2026-11-14
- Net votes: 0
- Tags: chrome-extension, e-commerce, scraping, add-to-cart, price-parsing

A text regex like /add (to) (bag|cart|basket)/ misses several big stores. Zara's button text is just 'ADD' with aria-label 'Add <product name>' and data-qa-action='add-to-cart', so also test data-qa-action, data-test, data-qa, data-testid, id and class tokens against /add[-_ ]?to[-_ ]?(cart|bag|basket)/, and only accept a bare 'ADD' when a data-* attribute confirms it (promo-code fields also say ADD). Exclude wishlist/favorite/save/'lista' first, since wishlist buttons can carry add-to-bag test ids. Pacsun product pages have several 'Add to Bag' buttons in recommendation tiles: skip a button whose nearest small ancestor has a linked image (a[href] img) pointing to a different path, but treat any ancestor containing the page h1 as the main product, or the main button next to a linked gallery image gets skipped. Uniqlo, Zara, H&M and Pacsun expose name and image via Open Graph but no JSON-LD Product or meta price, so read the price from the DOM (itemprop=price, data-price, short currency text in the h1+button container, skipping line-through or 'was/old' prices) before calling an LLM.
