Add grocery items to cart via Snoonu delivery platform in Qatar. Use when user wants to order groceries from Monoprix, Lulu, or other Snoonu stores. Searches products, selects best matches, and adds to cart via browser automation.
Add items to cart from Snoonu (Qatar's delivery platform) using browser automation.
https://snoonu.com/groceries/monoprix)| Store | menu_id |
|---|---|
| Monoprix | 504231 |
| Lulu Hypermarket | 509307 |
Use the search API to get candidates:
// In Playwriter - search via page context
const results = await page.evaluate(async (term) => {
const res = await fetch('https://admin.snoonu.com/api/search/suggest_in_merchant_with_subcategory', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ term, language: 'en', menu_id: 504231 })
});
const data = await res.json();
return data.data?.product_view_models?.slice(0, 5).map(p => ({
id: p.product_id,
name: p.name,
price: p.price,
inStock: p.is_instock
}));
}, 'red onion');
Review results and pick the exact match:
| Priority | Criterion | Example |
|---|---|---|
| 1 | Exact type match | "Fancy Meat Tuna" vs "Tuna Slices" |
| 2 | Whole over processed | "Melon Rock 1Kg" vs "Cut bowl" |
| 3 | Local origin | Qatar/Jordan/Oman items |
| 4 | Price per unit | 1kg bags > small packs |
See selection-guide.md for detailed criteria.
Navigate and click Add button via JS (avoids timeouts):
// Search in store UI
await page.locator('input[placeholder*="Search"]').fill('melon rock 1kg');
await page.locator('input[placeholder*="Search"]').press('Enter');
await page.waitForTimeout(2000);
// Click exact product
await page.locator('text="Melon Rock 1Kg"').first().click();
await page.waitForTimeout(1000);
// Add via JS click
await page.evaluate(() => {
const btn = Array.from(document.querySelectorAll('button'))
.find(b => b.textContent?.trim() === 'Add');
if (btn) btn.click();
});
page.evaluate() to avoid Playwright timeouts| Item | Search Term |
|---|---|
| Red onion | "onion red 1kg" |
| Potatoes | "potato regular 1kg" |
| Tuna (chunks) | "alali fancy tuna" |
| Greek yoghurt | "baladna greek yoghurt" |
| Rock melon | "melon rock 1kg" |