Being not fimilar with js or coffeescript, I intended to use casperjs to download pages and to use python to parse it. But I found the pages I downloaded didn't like the ones I saw in the broswer-actually some parts of them hadn't been loaded before the pages were saved. I guess the reason may be that onload callbacks haven't been executed. What should I do, if I want to download pages same as the ones I see in the browser? Thanks very much!
My code (coffeescript):
urls =
'jd' : 'http://list.jd.com/652-654-831-0-0-0-0-0-0-0-1-1-1-1-1-72-4137-33.html'
casper = require("casper").create()
process = (urls) ->
casper.start "", ->
@echo "begin to work"
for name, url of urls
casper.thenOpen url, ->
@echo @download url, "#{name}.html"
process(urls)
casper.run()