title: How to execute a javascript in a Python webdriver
body: <p>Selenium 2 Python webdriver:</p>
  
  <p>I was trying to click on an element which is hidden due to the hover effect and was looking for options to unhide and be able to select the element. To do this, I referred to some examples like below:</p>
  
  <p>In java:</p>
  
  <pre><code>JavascriptExecutor je = (JavascriptExecutor) webDriver();
  </code></pre>
  
  <p>Another example:</p>
  
  <pre><code>browser.execute_script("document.getElementsByClassName('classname').style.display='block'")
  </code></pre>
  
  <p>When I ran the above example, I got the following exception:</p>
  
  <pre><code>selenium.common.exceptions.WebDriverException: Message: '' 
  </code></pre>
  
  <p>I am not sure if I had to include any class for executing the javascript. Please let me know if there is anything iam missing.</p>