title: Node js cheerio showing wrong html source code
body: <p>I am trying to scrape the url given in this code to get the coordinates using class <code>ng-binding</code> for tag <code>p</code></p>
  
  <pre><code>Const request = require('request') 
  Const cheerio = require('cheerio') 
  Const logger = require('winston') 
  
  request(`https://pokedex100.com/discord/coord=2zHeG5fz71icW`, function (error, response, html) {
                  if (!error &amp;&amp; response.statusCode == 200) {
                      logger.info(html);
                      var $ = cheerio.load(html)
                      var cord = $('p.ng-binding').text()
                      logger.error(cord)
                  }
              });
  </code></pre>
  
  <p>I get the following html., which is not the same as what I get when viewing the source code manually. Can someone guide me on this? </p>
  
  <pre><code>22:32:43 - info: &lt;!DOCTYPE html&gt;&lt;html&gt;
  
  &lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;meta content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no" name="viewport"&gt;
  
    &lt;meta property="og:type" content="website" /&gt;  &lt;meta property="og:site_name" content="Discord" /&gt;  &lt;meta property="og:title" content="Discord - Free voice and text chat for gamers" /&gt;  &lt;meta property="og:description" content="Step up your game with a modern voice &amp; text chat app. Crystal clear voice, multiple server and channel support, mobile apps, and more. Get your free server now!"  /&gt;&lt;meta property="og:image" content="https://discordapp.com/assets/ee7c382d9257652a88c8f7b7f22a994d.png" /&gt;  &lt;meta name="twitter:card" content="summary_large_image"&gt;  &lt;meta name="twitter:site" content="@discordapp"&gt;  &lt;meta name="twitter:creator" content="@discordapp"&gt;
    &lt;link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/lcbhdgefieegnkbopmgklhlpjjdgmbog"&gt;
  &lt;link rel="stylesheet" href="/assets/24cfd050a820092e88717a7b474a1087.css" integrity="sha256-WYgktx8T6Pkz7IBvCEpViHtcNBJDI9tykxV3SpLkz+s= sha512-fXegHnQBxgOX43MAMz9XZZpa4gxVLtgwj2vfRn/OOsMUGT+VJYqti68o0ok7QunHggCNlv1oNsM1DDl9o+jZJw=="&gt;&lt;link rel="icon" href="/assets/07dca80a102d4149e9736d4b162cff6f.ico" /&gt;  &lt;title&gt;Discord&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div id="app-mount"&gt;&lt;/div&gt;
    &lt;script&gt;window.__require = window.require&lt;/script&gt;
    &lt;script&gt;window.__OVERLAY__ = /overlay/.test(location.pathname)&lt;/script&gt;&lt;script&gt;!function(){if(null!=window.WebSocket){var n=function(n){try{var e=localStorage.getItem(n);return null==e?null:JSON.parse(e)}catch(n){return null}},e=n("token"),o=n("gatewayURL");if(e&amp;&amp;o){var r=null!=window.__require?"etf":"json",t=o+"/?encoding="+r+"&amp;v=6";void 0!==window.Uint8Array&amp;&amp;(t+="&amp;compress=zlib-stream"),console.log("[FAST CONNECT] "+t+", encoding: "+r+", version: 6");var a=new WebSocket(t);a.binaryType="arraybuffer";var s=Date.now(),i={open:!1,gateway:t,messages:[]};a.onopen=function(){console.log("[FAST CONNECT] connected in "+(Date.now()-s)+"ms"),i.open=!0},a.onclose=a.onerror=function(){window._ws=null},a.onmessage=function(n){i.messages.push(n)},window._ws={ws:a,state:i}}}}();&lt;/script&gt;&lt;script src="/assets/ef85b442dc6e960fcdb2.js" integrity="sha256-YRcm2EGe1y248RLha42j5bJzgo7unYVPfEaRjIfI6OU= sha512-5rFJb426vcPzMhaOWbyhgHe5rP59EMHbQlYChDbJ5Ivjxkg3HBcF4qhU6d6OMxNaQ8ivLJGiReIVUNyQYKOE9A=="&gt;&lt;/script&gt;&lt;script src="/assets/f36f220d9b6f06eed734.js" integrity="sha256-gERbeDHAE3txb+KP87BEkbIawMeMaMnLTZ5gGRXpYv8= sha512-2mJlwmLdySqA+3psIzKCkNG+ThSLeOAls13fO6sFLQveqomiys1HAei4MHx4eCYizZ1uzXqJWq6gmrmMpzHH+Q=="&gt;&lt;/script&gt;&lt;/body&gt;
  
  &lt;/html&gt;
  22:32:43 - error:
  </code></pre>
  
  <p><strong>Edit:</strong></p>
  
  <pre><code>const browser = await puppeteer.launch({ headless: false, timeout: 1000000 });
      let page = await browser.newPage();
      page.setDefaultNavigationTimeout(1000000)
      await page.goto('https://pokedex100.com/?d=dcgrtr4WmaRvW', { waitUntil: "domcontentloaded" });
      await page.waitForSelector('input[id="register-email"]', { timeout: 1000000 });
      await page.type('input[id="register-email"]', "my_email_id")
      await page.type('input[id="register-password"]', "my_login_password")
      await page.click('button[class="btn btn-primary"]')
      await page.waitForSelector('button[class="primary"]', { timeout: 1000000 })
      await page.click('button[class="primary"]')
  
      page = await browser.newPage(); // See justification below
      page.waitFor(5000)
      page.setDefaultNavigationTimeout(1000000)
      await page.goto('https://pokedex100.com/?d=dcgrtr4WmaRvW', { waitUntil: "domcontentloaded" })
      await page.waitForSelector('p[class="ng-binding"]', { timeout: 1000000 }).then(async cords =&gt; {
          //let cord = await page.$('p[class="ng-binding"]')
          console.log("target")
          console.log(page.target)
          page.$eval('p[class="ng-binding"]', element =&gt; {
              console.log("element.innerHTML")
              console.log(element.innerHTML)
              console.log(element.textContent)
              console.log(element.nodeName + ' ' + element.nodeValue)
          })
      })
  </code></pre>
  
  <p>The reason why I used, page = browser.newPage() is because, I observed that, it takes time for the page to load on the <code>target</code>, but it loads faster when i open the new window.</p>