Skip to content

Instantly share code, notes, and snippets.

@ZECTBynmo
Created July 19, 2018 21:29
Show Gist options
  • Save ZECTBynmo/f6cb68f0a204055c39113c8064e177a5 to your computer and use it in GitHub Desktop.
Save ZECTBynmo/f6cb68f0a204055c39113c8064e177a5 to your computer and use it in GitHub Desktop.
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