Created
July 19, 2018 21:29
-
-
Save ZECTBynmo/f6cb68f0a204055c39113c8064e177a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rp = require('request-promise') | |
const Nightmare = require('nightmare') | |
const run = async () => { | |
const nightmare = Nightmare({ | |
show: false | |
}) | |
let allTypes = [] | |
const names = await nightmare | |
.goto('http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_1/script/record/account.html') | |
.evaluate(() => | |
$('button[name="alphabetswitch"]').get().map(function(r) { | |
return r.onclick.toString().split('/').pop().split('.')[0] | |
}) | |
) | |
for (name of names) { | |
const results = await nightmare | |
.goto(`http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_1/script/record/${name}.html`) | |
.evaluate(() => | |
$('#recordlist button').get().map(function(r) { | |
return r.onclick.toString().split('/').pop().split('.')[0] | |
}) | |
) | |
allTypes = allTypes.concat(results) | |
} | |
console.log("ALL TYPES", JSON.stringify(allTypes, null, 2)) | |
} | |
run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment