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

187
Vistas
How do I use javascript code in a web request C#

I'm not fully sure how to explain this: but I need to execute javascript code on a site via a C# webrequest, and use a GET request on the site with the js code executed.

I need to put the code

function getTitlesAndLinks() {
    var arr = [...document.getElementsByTagName('h3')];

    var filteredHeadings = [];
    var filteredLinks = [];

    arr.forEach(x => filteredHeadings.push(x.innerText));
    arr.forEach(x => filteredLinks.push(x.baseURI));

    var printToScreen = "";

    for(let i = 0; i < filteredHeadings.length; i++) {
      printToScreen +=
        "<div><p>" +
        filteredHeadings[i] +
        "</p><p><a href=" +
        filteredLinks[i] +
        ">" +
        filteredHeadings[i] +
        "</p></a></div><br>"
    }
    return printToScreen;
}
document.body.innerHTML = getTitlesAndLinks();

Into google's search and get the results

Any idea on how I can do this?

For more insight, I am using the Leaf.xNet library for my HTTP requests

I have tried to do this by adding java headers and stuff but I have no idea where to start

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