getElementByClassName is not a method on document. You'll want to use
but only if you are sure it's the only one with that class.
And you can also do this:
element = driver.find_element_by_class_name('classname')
var element = arguments;
var element = document.querySelector(".classname");
This solution is much better if you use a remote server to run the tests (like BrowserStack and so on) but there's a non-negligible cost for communication between the Selenium client and the server.
This worked for me. Check it out!