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
chatBox = driver.find_element(By.XPATH, "//div[@class='chatContainer oldStyle']").remove()
This line of code gives the error
AttributeError: 'WebElement' object has no attribute 'remove'
Any help would be much appreciated