Retrieve all pages and write results to CSV