-
Notifications
You must be signed in to change notification settings - Fork 0
/
pjScrape.js
33 lines (28 loc) · 1.09 KB
/
pjScrape.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*////////////////////////////////////////////////////
// Script initialisation
////////////////////////////////////////////////////*/
phantom.injectJs("pjScrape/scripts/pjGlobals.js");
phantom.injectJs("pjScrape/scripts/pjMessages.js");
phantom.injectJs("pjScrape/scripts/pjCommon.js");
phantom.injectJs("pjScrape/scripts/pjPage.js");
importAppConfig("pjScrape/config/app.config.json");
// If a data source code or name has been provided
if (sysArgs[1]) {
getSystemTitle();
importDataSourceDetails(sysArgs[1]);
importDataSourceInputRecords(appConfig.filePaths.dataSourceInput);
if (appConfig.scrapeSettings.updateInputFile){
createInputFileBackup();
}
if (appConfig.scrapeSettings.generateRecordGuids) {
console.log(msg_inf_generatingRecordGuids);
}
createOutputFile(appConfig.filePaths.dataSourceOutput);
console.log(dataSourceConfigs.remote.initialRecordCount + msg_inf_initialRecCount)
beginScrape();
}
else {
console.log(msg_err_noSysArgsPassed);
console.log(msg_inf_expectedSysArgs);
phantom.exit();
}