title: Is it possible to modify an element in the DOM with Puppeteer before creating a screenshot?
body: <p>I ran into an issue where I nave a fairly simple Node process that captures a screenshot. Is it possible to change the <code>innerText</code> of an HTML element using Puppeteer, just before the screen capture is acquired?</p>
  
  <p>I have had success with using Puppeteer to type text in authentication fields and with logging into a site, but I was wondering if there is a similar method that would let me change the text in a specific element (using id or class name).</p>
  
  <p>Example of the screen capture code I'm using:</p>
  
  <pre><code>const puppeteer = require('puppeteer');
   (async () =&gt; {
      const browser = await puppeteer.launch()
      const page = await browser.newPage()
      await page.goto('https://google.com')
      await page.screenshot({path: 'google.png'})
      await browser.close()
   })()
  </code></pre>
  
  <p>In this example, I would be interested in knowing if I can change the text content of an element such as the div with the ID 'lga' ... adding a text string for example.</p>
  
  <p>Is that possible with Puppeteer?  </p>
  
  <p>Otherwise, it works great. I just need to insert some text into the page I'm performing a screenshot of. I'm using the command-line only on a Ubuntu 16.04 machine, and Node version 9, Puppeteer version 1.0.0.</p>