title: Puppeteer write in input field
body: <p>I am new to puppeteer and want to write to the username input of this website with puppeteer in headless mode:
  <a href="https://partner.spreadshirt.de/login" rel="nofollow noreferrer">https://partner.spreadshirt.de/login</a></p>
  <p>The wikipedia example from <a href="https://stackoverflow.com/questions/47966510/how-to-fill-an-input-field-using-puppeteer">How to fill an input field using Puppeteer?</a> works fine on wikipedia. On github, something like <code>const selector = &quot;input.form-control.input-block&quot;;</code> worked fine, but not on the login page of spreadshirt. The selector of the input, I want to fill is #username and a <code>document.querySelector(&quot;#username&quot;)</code> in devtools returns the input no problem. But if I wait for the selector in puppeteer, I run into timeouts.</p>
  <pre><code>const puppeteer = require(&quot;puppeteer&quot;);
  
  (async () =&gt; {
    const browser = await puppeteer.launch();
    const page = await browser.newPage();
    await page.goto(&quot;https://partner.spreadshirt.de/login&quot;, {
      waitUntil: &quot;networkidle2&quot;
    });
  
    await page.waitFor(&quot;input[name=username]&quot;);
    await browser.close();
  })();
  </code></pre>
  <p>All my variations of the selector have not been successful so far, like <code>#username</code>, <code>input#username.textinput__input</code>, <code>.textinput__input</code>... When I log the page.content(), the main content div of the page is not logged at all, it is probably loaded later by some javascript. Is it possible to fill the input with puppeteer and how would that look in code?</p>