Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!