phantomJS + casperJS app crashing - not sure how to proceed, think I'm doing something pathological.

9 views
Skip to first unread message

Aaron Cammarata

unread,
Apr 1, 2013, 9:02:01 PM4/1/13
to phan...@googlegroups.com
Hi all -

Ok, before we begin, I know this is my fault. I could really use some help from the gurus as to what my next step might be.

I'm writing a casperJS script (attached at the bottom) as a personal project to improve my weak JS skills. The goal is to log in to gocomics.com and navigate through the site, pulling each comic out into its own file, which I'll then reconsititute into my own personal "funnies page".

The script is mostly working - but I don't think it's using casperJS correctly. In particular, since the number of comics I need to scrape is variable and unknown before runtime, I can't use the casper.then mechanism. (My understanding is that I'd need the correct number of casper.then calls.)

The problem is that I keep getting "phantomJS has crashed" - but at different times. Sometimes it will log in and get through about half of the comics. Other times it will crash while logging in. I don't know how to debug further.

My first thought is that setting Timeouts to delay the saveComic() function is probably creating a big nasty call stack or something...or maybe since the script finishes, that's probably a bad thing, since it's still trying to setTimeout and such after the casper.run is done.

I know this is the phantomJS list, I hope someone here has a pointer. I can generate a stack trace if that's the correct next step, but I really think the issue has more to do with how I've coded it than any problem with phantomJS.

Thank you very much for helping a n00b!
Aaron
comicStripper.js
Reply all
Reply to author
Forward
0 new messages