title: How do I remove an element in selenium python
body: <p>I was wondering how to remove an element in selenium python, I'm wanting to remove a chatBox in a website like how you would if you manually did it by pressing backspace, but I want to do it in selenium. So far I've tried this</p>
  <pre><code>chatBox = driver.find_element(By.XPATH, &quot;//div[@class='chatContainer oldStyle']&quot;).remove()
  </code></pre>
  <p>This line of code gives the error</p>
  <pre><code>AttributeError: 'WebElement' object has no attribute 'remove'
  </code></pre>
  <p>Any help would be much appreciated</p>