This is a short script to scrape an infinite scroll page and write the resulting HTML to a file
You'll need to install CasperJS; on a Mac that will involve brew install casperjs --devel
(if you don't have Homebrew, you can read how to do so here)
To run the script, you can use casperjs scrape.js --ssl-protocol=any
from the command line.
Thank you so much. I had to add
getContent();
inside the Otherwise section for it to keep working forever, but it reaches a point and stops scrolling (The Now scrolled is still the same for 40 minutes now). I have confidence that the webpage I'm scraping is infinite scroll: it has too much content for the webpage. How do I solve that?