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
//formLoc is the root element to look under. It should be a string representing a css selector | |
//if testing is true print the easily debuggable obj. If not true, drop the debug "element" keys and json.stringify | |
var getSelectors = function(formLoc, testing=false) { | |
var counter = 1; | |
var results = {}; | |
var getTheseTags = 'a,button,input'; | |
//css selector to find children of. Loop over each and use the most-desirable option as their location strategy | |
$$(`${formLoc} ${getTheseTags}`).forEach(function(el) { | |
if(el.attributes.hasOwnProperty('id')){ | |
results[`needsName${counter}`] = {element: el, id: el.id} |
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
var express = require('express'); | |
var bodyParser = require('body-parser'); | |
var yargs = require('yargs'); | |
var argv = require('yargs') | |
.alias('p','port') | |
.number('p') | |
.require('p') | |
.argv |