--
You received this message because you are subscribed to a topic in the Google Groups "Autofill Chrome Extension" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/chrome-autofill/F2QR0fFT83A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chrome-autofi...@googlegroups.com.
To post to this group, send email to chrome-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chrome-autofill/ff1afaaa-126b-4a62-80d9-bcf947a72835%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
(function() {
// Click "Add to Cart" button if it exists
var elAddToCart = document.getElementById('add-to-cart-button');
if (elAddToCart) elAddToCart.click();
// Wait for "Cart" or "Continue" button to show
var nTick = 0,
nTimer = setInterval(function() {
// The button can be any of these CSS selectors
var elButton = document.querySelector(
'.a-popover-wrapper [type="submit"],' +
'[aria-labelledby="attach-sidesheet-view-cart-button-announce"],' +
'#hlb-view-cart-announce,' +
'.s_editCart hlb-cart-button'
);
// Time out after 10 seconds
if (++nTick===20 || elButton) clearInterval(nTimer);
// Click on button when it appears
if (elButton) elButton.click();
}, 500); // Repeat every 500 ms
})();
(function() {
// Change Quantity to "999" if the field exists
var elQty = document.querySelector('[name="quantityBox"]');
if (elQty) elQty.value = '999';
// Click "Update" button if it exists
var elUpdate = document.querySelector('[data-action="update"]');
if (elUpdate) elUpdate.click();
else return;
// Wait for stock message to appear and scrape data
var nTick = 0,
nTimer = setInterval(function() {
var elMsg = document.querySelector('.sc-quantity-update-message'),
elProd = document.querySelector('[data-asin]');
// Time out after 10 seconds
if (++nTick===20 || (elMsg && elProd)) clearInterval(nTimer);
// Log product info to the console (F12 / Console tab)
if (elMsg && elProd) {
console.log(
'Product: ' + elProd.querySelector('.sc-product-title').innerText.trim() +
'\nASIN: ' + elProd.getAttribute('data-asin') +
'\nItem ID: ' + elProd.getAttribute('data-itemid') +
'\nPrice: ' + elProd.getAttribute('data-price') +
'\nQuantity: ' + elProd.getAttribute('data-quantity')
);
}
}, 500); // Repeat every 500 ms
})();
--
You received this message because you are subscribed to a topic in the Google Groups "Autofill Chrome Extension" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/chrome-autofill/F2QR0fFT83A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chrome-autofi...@googlegroups.com.
To post to this group, send email to chrome-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chrome-autofill/377be873-489c-4d48-b914-5d83dff829b4%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Autofill Chrome Extension" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/chrome-autofill/F2QR0fFT83A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chrome-autofi...@googlegroups.com.
To post to this group, send email to chrome-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chrome-autofill/ff941b67-2be7-4d23-878e-1ea336c409b1%40googlegroups.com.