title: How to get data from json file to js using puppeteer
body: <p>How can i get data such as username and password from json file?</p>
  <pre><code>const { errors } = require('puppeteer');
  const puppeteer = require('puppeteer-extra');
  
  (async () =&gt; {
      const browser = await puppeteer.launch({
        headless: false,
        ignoreHTTPSErrors: true,
        webpage: true,
        slowMo: 3,
        executablePath: &quot;C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe&quot;,
      });
  
      const page = await browser.newPage();
      await installMouseHelper(page); // Makes mouse visible
      await page.setDefaultNavigationTimeout(0);
      await page.evaluate(() =&gt; { debugger; });
      await page.goto('https://nike.com/my/login');
  
      await page.waitFor(500);
      const login = '[data-componentname=&quot;emailAddress&quot;]';
      loginButton = await page.waitForSelector(login),
      await loginButton.click(),
      await loginButton.type(&quot;test@gmail.com&quot;);
  
      await page.waitFor(500);
      const loginPsw = '[data-componentname=&quot;password&quot;]';
      loginPswButton = await page.waitForSelector(loginPsw),
      await loginPswButton.click(),
      await loginPswButton.type(&quot;Qwert12345.&quot;);
  
      await page.waitFor(500);
      const signInBtn = '[class=&quot;nike-unite-submit-button loginSubmit nike-unite-component&quot;]';
      signInBtnButton = await page.waitForSelector(signInBtn),
      await signInBtnButton.click();
  
  })();
  </code></pre>
  <pre><code>{
  &quot;nikeSNKRS&quot;: {
      &quot;accounts&quot;: [
          {
              &quot;note&quot;: &quot;&quot;,
              &quot;accounts&quot;: [
                  {
                      &quot;user&quot;: &quot;test@gmail.com&quot;,
                      &quot;password&quot;: &quot;Qwert12345.&quot;,
                      &quot;access_token&quot;: &quot;&quot;,
                      &quot;refresh_token&quot;: &quot;&quot;,
                      &quot;expires_in&quot;: &quot;&quot;,
                      &quot;token_type&quot;: &quot;&quot;,
                      &quot;country&quot;: &quot;&quot;,
                      &quot;phone&quot;: &quot;&quot;,
                      &quot;expires&quot;: &quot;???&quot;,
                      &quot;proxy&quot;: &quot;&quot;
                  }
              ]
          }
      ]
    }
  }
  </code></pre>