title: Puppeteer not working as expected when clicking button
body: <p>My problem is that I need to set the comment selector to "all comments" whit puppeteer but the comments don't render after that puppeteer clicks on the correct button, "all the comments", the comment section just disappears, I will provide the code and a video of the browser in action.</p>
  
  <pre><code>const $ = require('cheerio');
  const puppeteer = require('puppeteer');
  const url = 'https://www.facebook.com/pg/SamsungGlobal/posts/';
  
  
  
  
  
  
  
  const main = async () =&gt; {
    const browser = await puppeteer.launch({
      headless: false,
      args: ['--no-sandbox', '--disable-setuid-sandbox']
    });
    const page = await browser.newPage();
    await page.setViewport({
      width: 1920,
      height: 1080
    });
    await page.goto(url, {
      waitUntil: 'networkidle2',
      timeout: 0
    });
    page.mouse.click(50, 540, {});
    for (var a = 0; a &lt; 18; a++) {
      setTimeout(() =&gt; {}, 16);
      await page.keyboard.press('ArrowDown');
    }
    let bodyHTML = await page.evaluate(() =&gt; document.body.innerHTML);   
    var id = "#" + $("._427x ._4-u2.mbm._4mrt", bodyHTML).attr('id');      // selects id of first post
    try {
      var exp = await page.$(`${id} a._21q1`);   // clicks on "most relevant" from the first post 
      await exp.evaluate(exp =&gt; exp.click());
      await page.click('div[data-ordering="RANKED_UNFILTERED"]');    // selects "all the comments"
      var exp = await page.$(`${id} a._42ft`);         // should click on "more comments" but it doesn't load
      await exp.evaluate(exp =&gt; exp.click());
      await page.waitForSelector(`${id} a._5v47.fss`);       // wait for the "others" in facebook comments
      var exp = await page.$$(`${id} a._5v47.fss`);
      await exp.evaluate(exp =&gt; exp.click());
      await page.screenshot({
        path: "./srn4.png"
      });
      // var post = await page.$eval(id + " .userContentWrapper", el =&gt; el.innerHTML);
      // console.log("that's the  post " + post);
    } catch (e) {
      console.log(e);
    }
    setTimeout(async function() {
      await browser.close();     //close after some time
    }, 1500);
  };
  
  
  main(); 
  </code></pre>
  
  <p>That's the video of the full execution process: <a href="https://youtu.be/jXpSOBfVskg" rel="nofollow noreferrer">https://youtu.be/jXpSOBfVskg</a>
  That's a slow motion of the moment it click on the menu: <a href="https://youtu.be/1OgfFNokxsA" rel="nofollow noreferrer">https://youtu.be/1OgfFNokxsA</a></p>