title: How to get multiple DOM elements with chrome-remote-interface node js?
body: <p>I am just trying to build a crawler with chrome-remote-interface but i don't know how to get multiple dom elements like specific targets id,classes.</p>
  
  <p>for Ex:</p>
  
  <pre><code>price = document.getelementbyid('price')
  
  name= document.getelementbyid('name')
  </code></pre>
  
  <p>Code</p>
  
  <pre><code>    const CDP = require('chrome-remote-interface');
      CDP((client) =&gt; {
        // Extract used DevTools domains.
        const {Page, Runtime} = client;
  
        // Enable events on domains we are interested in.
        Promise.all([
          Page.enable()
        ]).then(() =&gt; {
          return Page.navigate({url: 'http://example.com'})
        });
  
        // Evaluate outerHTML after page has loaded.
        Page.loadEventFired(() =&gt; {
          Runtime.evaluate({expression: 'document.body.outerHTML'}).then((result) =&gt; {
  //How to get Multiple Dom elements
            console.log(result.result.value);
            client.close();
          });
        });
      }).on('error', (err) =&gt; {
        console.error('Cannot connect to browser:', err);
      });
  </code></pre>
  
  <p>Update</p>
  
  <pre><code>const CDP = require('chrome-remote-interface');
  
  CDP((client) =&gt; {
    // Extract used DevTools domains.
    const {DOM,Page, Runtime} = client;
  
    // Enable events on domains we are interested in.
    Promise.all([
      Page.enable()
    ]).then(() =&gt; {
      return Page.navigate({url: 'https://someDomain.com'});
    })
    Page.loadEventFired(() =&gt; {
      const expression = `({
              test: document.getElementsByClassName('rows')),
          })`
      Runtime.evaluate({expression,returnByValue: true}).then((result) =&gt; {
        console.log(result.result) // Error
        client.close()
      })
    })
  }).on('error', (err) =&gt; {
    console.error('Cannot connect to browser:', err);
  });
  </code></pre>
  
  <p>Error</p>
  
  <pre><code>{ type: 'object',
    subtype: 'error',
    className: 'SyntaxError',
    description: 'SyntaxError: Unexpected token )',
    objectId: '{"injectedScriptId":14,"id":1}' }
  </code></pre>
  
  <p>Actually I want to iterate over the list of elements But I don't know where it goes wrong</p>