title: Puppeteer Random user-agent args
body: <p>Recently I asked this random useragents from .json file but the thing is that after I added &quot;capture screen&quot; of puppeteer it keeps showing headless chrome, so I copied the previous topic answer into wrong place.</p>
  <p><strong>Now the real useragent js page came from this page:</strong></p>
  <pre><code>const browser = await puppeteer.launch({
  headless: false,
  args: ['--headless', '--disable-infobars', '--user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36', '--no-sandbox', `--proxy-server=socks5://127.0.0.1:${port}`] : ['--no-sandbox'],
  </code></pre>
  <p>});</p>
  <p>So how do I create rnadom list inside the arguments?
  My previous help which doesnt worked for me as the random useragents code was not in correct place is here: <a href="https://stackoverflow.com/questions/63973252/puppeteer-browser-useragent-list/63976320">Puppeteer browser useragent list</a></p>
  <p>But adding that code inside this wont work.</p>
  <p>So after <code>--user-agent=</code> I want to add &quot;<code>random</code>&quot; function but how?</p>