title: how to click button without id on casperjs
body: <p>Hello everybody I am a newbie on javascript and I am trying to learn Casper.js/Phantom.js, but today I encountered a problem. I am trying to login in <a href="https://angel.co/login?utm_source=top_nav_home" rel="nofollow">https://angel.co/login?utm_source=top_nav_home</a> site with auto filling. My code fills username and password correctly however my </p>
  
  <pre><code>casper.getElementsByName("commit").click();
  </code></pre>
  
  <p>doesnt work at all. So my program doesnt login to the account. When I inspect element I dont see any id tag, I see name so I use getElementByName.My code is like this below</p>
  
  <pre><code>    phantom.casperPath = 'C:/casperjs';
  phantom.injectJs(phantom.casperPath + '/bin/bootstrap.js');
  var casper = require('casper').create({
      pageSettings: {
          loadImages: false,
          loadPlugins: false,
          userAgent: 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36'
      }
  });
  
  //First step is to open angellist
  casper.start().thenOpen("https://angel.co/login", function () {
      console.log("angel website opened");
  });
  
  
  //lets fill username and pass login 
  casper.then(function () {
      console.log("Login using username and password");
      this.evaluate(function () {
          document.getElementById("user_email").value = "myemail";
          document.getElementById("user_password").value = "mypassword";
        //casper.getElementsByName("commit").click();
        //THIS ONE ABOVE DOESN'T WORK  
  
      });
  });
  </code></pre>
  
  <p>after this I take a screenshot but I see that it doesnt click the login button.
  I tried to click it using xpath too but it didn'work. Thanks for your help.</p>