Scrape Yellow Pages Canada for phone numbers, output the list to CSV file - Script removes duplicate phone numbers.
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.ca',
// areas to search
area: [
'calgary',
'toronto',
'montreal'
],
// business keyword
keyword: 'plumbing',
// creates complete link
search: function (pageNumber) {
return host.url + "/search/si/" + pageNumber + '/' + host.keyword + '/' + host.area;
}
};
Redirect your terminal to the scraper directory then -
$ casperjs scraper.js