Using autofill to cart an item

697 views
Skip to first unread message

ttd...@gmail.com

unread,
Sep 21, 2018, 2:08:20 PM9/21/18
to Autofill Chrome Extension
Hi All, disclaimer, I am not a programmer! I am trying to cart several items using the autofill rules (so I can checkout in 2 clicks rather than going through the process of adding my info again). So right now, I can cart one item and use the autofill. However, when I go back to the website and try to get another item, instead of autofilling everything, I have to go through the shipping, billing info, making me have to click 3-4 different pages to checkout. Is there any way I can program it so that I use the autofill every single time so I don't have to spend so much time clicking through different pages the second time around? Thanks in advance! The phone code option takes a while too (it's too slow). 

thdoan

unread,
Sep 21, 2018, 7:20:54 PM9/21/18
to Autofill Chrome Extension
Hi there, I know it can be done because people here have used Autofill to automate the entire checkout process on supremenewyork.com, and also the entire posting process (up to image upload) on craigslist. You have access to a powerful tool, but to unleash all the automation power you'll have to learn a bit of JavaScript. Every site is different and will require different JavaScript rules, which can be a big investment to learn to write on your own if you are not familiar with JavaScript (but a worthwhile investment of your time as you will be gaining valuable skills).

A GREAT resource to help with JavaScript questions is to ask on Stack Overflow. I use it all the time whenever I'm stuck on a problem, and it has always come through for me. Since what you're trying to accomplish is a complex task, what I suggest is to break down the checkout process into smaller chunks; for example, you can ask a separate question for each page you're trying to auto-click/select/fill/submit. Once you are able to do all of this from the JavaScript console (F12 / Console), then you'll be ready to create the rules in Autofill (pretty much copy and paste).

Good luck! :-)

Theresa Dinh

unread,
Oct 2, 2018, 1:36:30 AM10/2/18
to chrome-...@googlegroups.com
Thank you!

Sent from my iPad
--
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.

thdoan

unread,
Oct 2, 2018, 3:48:06 PM10/2/18
to Autofill Chrome Extension
To help get you started, below are a couple rules I wrote recently to help me check on a product's remaining inventory on Amazon. As soon as you land on an Amazon product page, Autofill automatically adds it to cart, go to the Cart page, update the quantity to 999 (to trigger a remaining inventory message), and log the product info to the console (F12 / Console tab). You can read the comments in the code to see exactly what it's doing.

Type = JavaScript
Value =
(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
})();


Type = JavaScript
Value =
(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
})();

thdoan

unread,
Oct 2, 2018, 3:50:18 PM10/2/18
to Autofill Chrome Extension
Forgot to add the Site filters...


Rule 2 site filter: https://www.amazon.com/gp/cart

Theresa Dinh

unread,
Oct 3, 2018, 7:29:56 PM10/3/18
to chrome-...@googlegroups.com
Thanks! Sorry, that is a bit over my head. I have no coding experience. I am looking for a way to cart and checkout faster (little girl's dresses)...see what I can automate if I don't know the product ID number. 

Thanks again!

--
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.

thdoan

unread,
Oct 4, 2018, 1:13:11 AM10/4/18
to Autofill Chrome Extension
Maybe if you tell me the site and product you'd like to add to cart, I can whip up a sample rule for ya...

Theresa Dinh

unread,
Oct 15, 2018, 12:20:19 PM10/15/18
to chrome-...@googlegroups.com
Can you whip up a code without the variant for the size? I have the product Id but not the variant info for the size. 

Thanks! 

Sent from my iPad
--
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.

thdoan

unread,
Oct 15, 2018, 1:26:54 PM10/15/18
to Autofill Chrome Extension
Most sites won't allow you to add a product to the cart if you don't select a size. Maybe if you provide the URL of the product page and describe what you'd like to automate, then I'll understand the situation better.
Reply all
Reply to author
Forward
0 new messages