{"version":"1.0","type":"rich","title":"exec-and-path-on-heroku-with-buildpacks","description":"This example demonstrates how to deploy a CasperJS scraper on Heroku using a custom buildpack, showing the process from initial setup through deployment and runtime execution. The code uses Node.js’s `child_process.exec` to invoke the CasperJS script, which relies on the PhantomJS buildpack to provide the necessary binaries. The Heroku logs reveal the key issue: the `PATH` and `LD_LIBRARY_PATH` environment variables are not configured for the custom buildpack, causing `node` to be unavailable when the scraper starts, leading to a crash with status 127. The data source is the Google homepage, and the scraper returns its title.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-3856317?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}