Scraping address information
This commit is contained in:
parent
726f3b8b9e
commit
ca9a5c2a5e
8495
scrape/data.json
8495
scrape/data.json
File diff suppressed because it is too large
Load Diff
@ -35,13 +35,18 @@ function reviewScraped(err, resp, html) {
|
|||||||
|
|
||||||
var $ = cheerio.load(html);
|
var $ = cheerio.load(html);
|
||||||
|
|
||||||
var bars = $('div.fill');
|
var address = $('span.format_address').text().trim();
|
||||||
if (bars.length != 9) {
|
if (!address) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var storeName = $('h1#HEADING').text().trim();
|
var storeName = $('h1#HEADING').text().trim();
|
||||||
if (storeName.indexOf('CLOSED') != -1) {
|
if (storeName.indexOf('CLOSED') !== -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var bars = $('div.fill');
|
||||||
|
if (bars.length !== 9) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,13 +60,14 @@ function reviewScraped(err, resp, html) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
'name': storeName,
|
name: storeName,
|
||||||
'relativeUrl': this.relativeUrl,
|
relativeUrl: this.relativeUrl,
|
||||||
'rating': {
|
address: address,
|
||||||
'food': (rateFood - 0.5) * 2.0,
|
rating: {
|
||||||
'service': (rateService - 0.5) * 2.0,
|
food: (rateFood - 0.5) * 2.0,
|
||||||
'value': (rateValue - 0.5) * 2.0,
|
service: (rateService - 0.5) * 2.0,
|
||||||
'atmosphere': (rateAtmosphere - 0.5) * 2.0
|
value: (rateValue - 0.5) * 2.0,
|
||||||
|
atmosphere: (rateAtmosphere - 0.5) * 2.0
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user