Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

163
Vistas
Fetch other web page and get async content

In my Greasemonkey script I'm fetching some other web page and using the response in my code. However when I do this, it only gets the initial HTML content. If some of the content is async (which loads later) then I can't see that content in the response.

My researchs told me to use "waitForKeyElements", but it only work if the current url = the fetching page. It doesn't work when I fetch data from another web page.

If there is something I can do for my needs (not necessarily DOMParser), please tell me.

Here is my code:

// this script runs when I'm in google.com

GM_xmlhttpRequest({
    url : "https://www.example.com",
    method : "GET",
    timeout: 10000,
    onload : function(response) {
        if (response.status == 200) {

            const parser = new DOMParser();
            const result = parser.parseFromString(response.responseText, "text/html").body; 
 
            let div = result.querySelector(".some-selector-here") 
            // returns null because this is async content


        } else {
            console.log(" Error: HTTP " +response.status+ " Error.");
        }
    },

});
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda