Selenium phantomjs (python) not redirecting to welcome page after login, page is load dynamically using dojo
I just discovered that my problem was with a elem.send_keys(Keys.ENTER) line. Phantomjs seems to be very fast so I had to put a time.sleep of 2 seconds before that line, and now the script works fine. What happened is that Enter button for login wasn't clicked properly. Of course time.sleep(2) isn't the best way to solve it, I will change the ENTER statement into a click with xpath.
I was trying to log into a website that is loaded fuly dinamically using dojo.js scripts. On my tests I am using:

Selenium 2.40
Phantomjs 1.9.7 (downloaded via npm)
Ubuntu 12.04

When I try my script with: driver = webdriver.Firefox()
Everything works fine, Firefox logins through login page /login.do, gets through authentication page and arrives at the landing page and everything works perfectly.
But I have to make this code for an Ubuntu Server so I can't use a GUI, when I change to: driver = webdriver.PhantomJS()
I arrived again at /login.do ( print driver.current_url)
I have tried to use WebDriverWait and nothing happens.
Does PhantomJS for python an issue with dynamically loading pages? If not,
can I use another tool or better yet, someone knows a book or tutorial to understand XHR Requests and doing this job with requests and urllib2?