Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

152
Visualizações
Is there a way to automatically fill a cart of an external ecommerce?

I'm trying to understand if it's feasable to open, for a user, an external ecommerce website and fill the cart instead of him with specific products (that the user selected on my website).

Up to now the following possible solutions came to my mind:

  1. Extension: the user download an extension, when he click on a button on the extension a new tab with the external ecommerce is opened, then a injected javascript script autocompile the cart (automating the clicks that lead to the "add to cart button")
  2. iFrame: it is the same of the above solution, but I was wondering if with an iFrame I could achieve the same thing I can achieve with an extension

Of the two solutions I'd prefer the second one, mostly because an extension could not be used in a mobile browser. However I'm wondering if there is some other faster solution client side (for example could an application make the automation process simpler?). Right now I implemented a very basic script for the extension solution:

Keep in mind that the wait will be sobstituted with a check of the loading status of the page or something like that

productList.forEach(product => {
        chrome.scripting.executeScript(
            {
            target: {tabId: tabs[0].id},
            func: loadProductPage,
            args: [product]
            }
        );

        wait(2000);

        chrome.scripting.executeScript(
            {
            target: {tabId: tabs[0].id},
            func: addToCart
            }
        );

        wait(1000);
    })

    wait(1000);

    chrome.scripting.executeScript(
        {
        target: {tabId: tabs[0].id},
        func: openCart
        }
    );

})

function loadProductPage(productUri){
    window.location.assign(productUri);
}

function addToCart() {
    document.getElementById("button-cart-add").click();
}

function openCart() {
    document.getElementsByClassName("icon-cart")[0].click();
    document.getElementsByClassName("cart-footer")[0].children[0].click();
}

I realize that is kind of a strange request, I'm a bit lost even on what to search online. It's like a web automation task but I only found things related to web testing or web crawling but not something in order to automate the actions of a user

about 4 years ago · Santiago Gelvez
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda