title: How to execute a Javascript function in python with selenium
body: <p>I have a function called 'checkdata(code)' in javascript, which, as you can see, takes an argument called 'code' to run and returns a 15-char string.</p>
  
  <p>So, I found out (and tested) how to call no-argument functions in javascript, but my problem is that when I call checkdata(code), I always get a 'none' return value. 
  This is what I'm doing so far:</p>
  
  <pre><code>wd = webdriver.Firefox()
  wd.get('My Webpage')
  a = wd.execute_script("return checkdata()", code)  //Code is a local variable
                                                     //from my python script
  print a
  </code></pre>
  
  <p>I'm making this, since I read it on an unofficial selenium documentation and here: <a href="https://stackoverflow.com/questions/5585343/getting-the-return-value-of-javascript-code-in-selenium/5585345#5585345">link</a></p>
  
  <p>But, as I said before, I just keep getting none printed.</p>
  
  <p>How can I call my function passing that parameter? </p>