title: puppeteer scroll and click on button
body: <p>i am using puppeteer to try to take a screenshot of a website but first i have to press a button called "Lifetime" its selector is:</p>
  
  <p><code>#profile &gt; div.trn-profile.dtr-profile &gt; div &gt; div.content &gt; div:nth-child(1) &gt; div.material-card &gt; a.btn.btn-season.selected</code></p>
  
  <p>i have to first scroll down press the lifetime button and take a screenshot of the "solo", "duo" and "squad" stats like this:</p>
  
  <p><a href="https://i.stack.imgur.com/leMj9.png" rel="nofollow noreferrer">target photo:</a></p>
  
  <p>i am trying this in non-headless mode to make sure it works but it doesnt seem to be working. i have got my code to the point where it will scroll down to the element but not click it using page.click(SELECTOR). so far i have been able to open the webpage and scroll down but when i try to use page.click it does not work. i will worry about the screenshot later once i can figure out how to press the "lifetime" button</p>
  
  <p>my code is:</p>
  
  <pre><code>var puppeteer = require('puppeteer');
  
  let scrape = async () =&gt; {
  
  const browser = await puppeteer.launch({
      headless: false
  });
  
  const page = await browser.newPage();
  
  await page.goto('https://fortnitetracker.com/profile/pc/Twitch.BadGuyBen');
  await page.tap('#profile &gt; div.trn-profile.dtr-profile &gt; div &gt; div.content &gt; div:nth-child(1) &gt; div.material-card &gt; a.btn.btn-season.selected');
  await page.waitFor(2000);
  
  await page.screenshot({
      path: 'stats.png',
      fullPage: true
  })
  
  browser.close();
  };
  
  scrape();
  </code></pre>
  
  <p>EDIT: i will take a fullscreen screenshot of the page then use jimp module to crop it so mainly i have to figure out how to press the button</p>
  
  <p>EDIT: im an idiot i was using the wrong selector my bad :)</p>