Probably a newbie question on nodejs/jsdom
You would be better of using something like casperjs http://casperjs.org/. It is a testing utility based on phantomjs. It is basically exactly like opening the page in a webkit browser, just without the GUI. You could write something like. I dont think it works with node, but it should be easy enough to run a casper script and pipe the output back to node.:
This recipe can be found in it's original form on Stack Over Flow.