title: Python 3 Selenium fails to execute javascript
body: <p>I'm using python 3 and I'm using Selenium to try to scrape data off a website. I need to remove a class from a list item in order to display the data I need, this is the code: </p>
  
  <pre><code>driver.execute_script("document.getElementsByClassName('otherClassName isSelected').classList.remove('isSelected');")
  </code></pre>
  
  <p>but I get the error </p>
  
  <blockquote>
    <p>"selenium.common.exceptions.WebDriverException: Message: unknown error:
    Cannot read property 'remove' of undefined"</p>
  </blockquote>
  
  <p>I have also tried </p>
  
  <pre><code>driver.execute_script("document.getElementsByClassName('otherClassName isSelected').setAttribute('class', 'otherClassName')")
  </code></pre>
  
  <p>but then I get</p>
  
  <blockquote>
    <p>selenium.common.exceptions.WebDriverException: Message: unknown error: document.getElementsByClassName(...).setAttribute is not a function</p>
  </blockquote>