class Scraper_Store_A { public static function fetch_discounted_products() { $url = 'https://store-a.com/discounts'; $html = @file_get_contents($url); if (!$html) { error_log("[DPS] Failed to fetch: $url"); return []; // fail gracefully } $dom = new DOMDocument(); @$dom->loadHTML($html); // suppress warnings $xpath = new DOMXPath($dom); $products = []; foreach ($xpath->query("//div[contains(@class, 'product')]") as $node) { $old_price = $xpath->query(".//span[@class='price-old']", $node); if ($old_price->length == 0) continue; $name = $xpath->query(".//h2", $node)->item(0)->nodeValue ?? 'Unnamed'; $price = $xpath->query(".//span[@class='price-new']", $node)->item(0)->nodeValue ?? ''; $url = $xpath->query(".//a", $node)->item(0)->getAttribute('href') ?? ''; $img = $xpath->query(".//img", $node)->item(0)->getAttribute('src') ?? ''; $products[] = [ 'name' => trim($name), 'price' => trim($price), 'url' => trim($url), 'image' => trim($img), 'category_slug' => 'tech-deals' ]; } return $products; } } 4K OLED UHD Smart LG 55 G42 LW, 55″(139.7cm) – Deals.mk
hello@deals.mk   |   partners@deals.mk   |   About   |   Contact
1

My Cart

1 Item(s) -38,999 ден

There are 1 item(s) in your cart
Subtotal: 38,999 ден

Wishlist

Shopping Cart

Subtotal: 38,999 ден
x
84109997_261efc9f-df0f-454a-8b8a-027288728125

4K OLED UHD Smart LG 55 G42 LW, 55″(139.7cm)

Our Price

Original price was: 106,999 ден.Current price is: 99,999 ден.