extractFlipkart() {
try {
const url = window.location.href;
console.log('Flipkart: Starting extraction from:', url);
// Extract Product ID
let productId = null;
// Method 1: From pid parameter
const pidMatch = url.match(/[?&]pid=([A-Z0-9]+)/i);
if (pidMatch) {
productId = pidMatch[1];
}
// Method 2: From /p/ path
if (!productId) {
const pathMatch = url.match(/\/p\/([A-Z0-9]+)/i);
if (pathMatch) {
productId = pathMatch[1];
}
}
if (!productId) {
console.error('Flipkart: Could not extract product ID');
return null;
}
console.log('✓ Flipkart: Product ID:', productId);
// Get title
let title = document.title.split(':')[0].split('|')[0].split('-')[0].trim();
if (!title || title.length < 10) {
title = 'Flipkart Product ' + productId;
}
// SCRAPE PREVIEW DATA (for popup display)
let previewPrice = null;
const priceSelectors = [
'div._30jeq3._16Jk6d',
'div._30jeq3',
'div._16Jk6d',
'div[class*="price"]'
];
for (const selector of priceSelectors) {
const priceEl = document.querySelector(selector);
if (priceEl) {
const priceText = priceEl.textContent;
const match = priceText.match(/₹([\d,]+)/);
if (match) {
previewPrice = parseFloat(match[1].replace(/,/g, ''));
console.log('Flipkart: Preview price found:', previewPrice);
break;
}
}
}
// Get preview image
const previewImages = [];
const imgSelectors = [
'img._396cs4._2amPTt',
'img[class*="product"]',
'div._1AtVbE img'
];
for (const selector of imgSelectors) {
const imgs = document.querySelectorAll(selector);
imgs.forEach(img => {
const src = img.src || img.getAttribute('data-src');
if (src && src.includes('flipkart.com') && !previewImages.includes(src)) {
const hqSrc = src.replace(/\/\d+\/\d+\//, '/800/800/');
previewImages.push(hqSrc);
}
});
if (previewImages.length > 0) break;
}
console.log('Flipkart: Preview images found:', previewImages.length);
return {
title: title,
price: previewPrice, // For preview
images: previewImages, // For preview
flipkart_product_id: productId, // For WordPress API
use_api: true, // Signal to use API
button_text: 'Buy on Flipkart',
};
} catch (error) {
console.error('Flipkart extraction error:', error);
return null;
}
}
LAPCARE RAPIDO Wired Gaming Keyboard and Mouse Combo with RGB Lighting, Membrane Keys, 8 Million Clicks, Optically Precise Tracking, USB Interface, Ergonomic Design for PC Gaming, White (LGC-213) -
Sale!
LAPCARE RAPIDO Wired Gaming Keyboard and Mouse Combo with RGB Lighting, Membrane Keys, 8 Million Clicks, Optically Precise Tracking, USB Interface, Ergonomic Design for PC Gaming, White (LGC-213)
Ultimate Gaming Combo: Lapcare Rapido LQC-213 Wired Gaming Keyboard & Mouse Combo designed for pro-level gaming performance, smooth control & lightning-fast accuracy.
RGB Backlit Keyboard: Stunning multi-color RGB lighting enhances your gaming setup, offering vibrant illumination for immersive gameplay—perfect for night gaming sessions. Long Wire, USB Interface, Plug and Play.
104 Membrane Keys with 8 Million Keystroke Life: Full-size 104-key layout with membrane switches ensures comfortable & accurate key response for long-lasting durability.
1600 Adjustable DPI Gaming Mouse: Equipped with 800/1200/1600 DPI levels and a quick DPI switch button, enabling precision aiming, fast movements, & ultimate cursor control.
USB Plug & Play: Hassle-free USB interface ensures instant connectivity with gaming PCs, laptops, and desktops—no software or drivers required.
Premium Build Quality: Durable, high-quality construction with sturdy keys and responsive mouse buttons designed to withstand intense gaming battles.
Smooth & Tactile Buttons: Mouse features 4 responsive control buttons for faster in-game actions, sniping accuracy, and smooth clicking experience.
Ergonomic White Design: Elegant White Champ Series design complements RGB glow, delivering a stylish, futuristic look for modern gaming desks.
1.5 Meter Long Cable – Zero Lag: Long, tangle-free cable ensures stable connectivity, no input lag, and seamless gaming performance.
Ideal for Gamers, Coders & Creators: Perfect for gaming, streaming, office work, and graphic design, offering speed, accuracy, and comfort for long hours.