-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatterns.js
More file actions
25 lines (23 loc) · 789 Bytes
/
patterns.js
File metadata and controls
25 lines (23 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
if (typeof window.SCRAPER_CONFIG === 'undefined') {
window.SCRAPER_CONFIG = {
// UPDATED: Selector Container Dinamis
containers: {
search: '.css-5wh65g', // Halaman Pencarian
shop: '.css-79elbk' // Halaman Produk Toko
},
// Pola Regex (Tetap sama)
patterns: {
price: /^Rp\s?[\d\.]+/i,
rating: /^[1-5]\.\d$/,
sold: /(\d+[rbjt\+]?)\s+(terjual|sold)/i,
discount: /^\d{1,2}%$/
},
// Pola Badge (Tetap sama)
badgePatterns: [
{ id: "Mall", regex: /badge_os\.png/i },
{ id: "Power Shop", regex: /Power%20Merchant%20Pro|Power_Merchant_Pro/i },
{ id: "Power Merchant", regex: /Power%20Merchant(?!%20Pro)|Power_Merchant(?!_Pro)/i }
]
};
}
console.log("Pattern Config Loaded:", window.SCRAPER_CONFIG);