title: webdriver.io how to remove elements from DOM with node.js
body: <p>Imagine I would visit a website. And on this website is a big amount of data. But all of this data has the same class. As example:</p>
  
  <pre><code>li.sampleClass
  </code></pre>
  
  <p>Then when you scroll down new data will be added with endless scroll. But the DOM will never be cleared.. Every new data will be stored as li.sampleClass this causes extrem high hardware usage and</p>
  
  <pre><code>.getText('li.sampleClass')
  </code></pre>
  
  <p>stop working with high amounts of multiple data with the same class. When you look in the Inspector you can see all the stored data. So I thought why not clear the DOM and delete the old data before scrolling to the next.</p>
  
  <p>Is there a way to remove complete classes or ID´s from the DOM with webdriver.io or do you know a other tricky way to split the process with .getText? Please notice that I use node.js on localhost and I don´t have access to the website. The website is online so I think I can´t use something like</p>
  
  <pre><code>.execute
  </code></pre>
  
  <p>from webdriver.io to clear the DOM via js or can I?</p>