title: How do I get the value of an element in headless chrome?
body: <p>I ran the following code:</p>
  
  <pre><code>await page.goto("http://github.com/", { "waitUntil": "networkidle2" });
  let divs = await page.evaluate(() =&gt; $("div"));
  </code></pre>
  
  <p>But this throws the following error:</p>
  
  <p><code>Error: Evaluation failed: ReferenceError: $ is not defined</code>.</p>
  
  <p>But when I check, it is defined:</p>
  
  <p><a href="https://i.stack.imgur.com/Hc9fx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hc9fx.png" alt="enter image description here"></a></p>