Scrap Yellow Pages for emails and return them in a list -
First use npm to install casperjs -
$ npm install casperjs
OR
$ npm install -g casperjs
Update the host{} in scraper.js -
var host = {
// main connect
url: 'http://yellowpages.com',
// areas to search
area: [
'/michigan',
'/california',
'/washington',
'/florida',
],
// business keyword
keyword: '/restaurant',
// creates complete link
search: function () {
return host.url + host.area[build.currentLocation] + host.keyword;
}
};
Redirect your terminal to the scraper directory then -
$ casperjs scraper.js