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

165
Views
Login > Go to Specific Page > Search > Grab Specific Content From Page Using Node JS and Puppeteer

I want to scrape some data from login protected page using Node Js and Puppeteer. When I try to scrape data, the shows page is not reachable. I don't have any idea about why I am getting output like this. Here is my code.

I am new to Puppeteer and Node Js, its been 8 hours I am trying to modify that code, but not working.

async function EmailLookup(MlsNumber)
{
    resp = new { Success = false };

     (page = await singletonBrowser.Instance.newPage())
    {
        await page.setRequestInterception(true);

         page.Request += (sender, e) =>
         {
            if (e.Request.resourceType === resourceType.document || e.Request.resourceType === resourceType.Script || e.Request.resourceType === resourceType.Xhr)
                e.Request.Continue();
             else
                 e.Request.Abort();
         };

        await page.async("https://example.com/idp/login");

        if (!page.Url.Contains("layouts"))
        {
            await page.waitForSelector("#username");

            await page.waitForSelector("#password");

            await page.waitForSelector("#loginbtn");

            await page.async("#username", "xxxxx");

            await page.async("#password", "xxxxx");

            await page.async("#password", "\r");

            await page.waitForNavigation(new navigationOptions { Timeout = 0 });
        }

        await page.goto("https://example.com/launch?layoutid=61&appid=433");

        await page.waitForSelector("#ctl02_m_ucSpeedBar_m_tbSpeedBar");

        await page.async("#ctl02_m_ucSpeedBar_m_tbSpeedBar", MlsNumber);

        await page.async("#ctl02_m_ucSpeedBar_m_tbSpeedBar", "\r");

        await page.waitForNavigation(new navigationOptions { Timeout = 0 });

        var MLSLink = await page.waitForXPath("//a[text()='" + MlsNumber + "']");

        if (MLSLink != null)
        {
            await MLSLink.click();
            await page.waitForNavigation(new navigationOptions{ Timeout = 0 });
            var Content = await page.get();

            htmldoc = new htmldoc();
            htmldoc.load(Content);

            var parcelNode = htmldoc.document.selectSingleNode("//a[contains(@href,'AssessorParcelDetail')]");
            var emailNode = htmldoc.document.selectSingleNode("//a[contains(@href,'mailto:')]");

            if (emailNode != null && parcelNode != null)
            {
                resp.Success = true;
                resp.Email = emailNode.innerText;
                resp.Parcel = parcelNode.innerText;
            }
        }

        return json(resp);
    }
}
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!