update
This commit is contained in:
parent
513353a2a0
commit
fcc53ee3e7
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
node_modules/
|
||||
*.swp
|
||||
|
17
index.js
17
index.js
@ -1,18 +1,23 @@
|
||||
const { Builder, By, Key, until } = require('selenium-webdriver')
|
||||
const chrome = require('selenium-webdriver/chrome')
|
||||
const firefox = require('selenium-webdriver/firefox')
|
||||
|
||||
const setsUrl = 'https://www.echomtg.com/sets/'
|
||||
|
||||
const setsClass = '.main.marketAnalysis.sets'
|
||||
|
||||
;(async () => {
|
||||
let cOpts = new chrome.Options()
|
||||
cOpts.headless()
|
||||
cOpts.setChromeBinaryPath('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome')
|
||||
|
||||
let driver = await new Builder().forBrowser('chrome').setChromeOptions(cOpts).build()
|
||||
let ffOpts = new firefox.Options()
|
||||
ffOpts.headless()
|
||||
ffOpts.setBinary('/root/apps/firefox/firefox')
|
||||
let driver = await new Builder().forBrowser('firefox').setFirefoxOptions(ffOpts).build()
|
||||
await driver.get(setsUrl)
|
||||
let el = await driver.findElement(By.css(setsClass))
|
||||
console.log(await el.getText())
|
||||
let sets = await el.findElements(By.css('h4>a'))
|
||||
|
||||
for (let it of sets) {
|
||||
console.log(await it.getText())
|
||||
}
|
||||
//console.log(sets)
|
||||
})().catch(console.warn)
|
||||
|
||||
|
60
package-lock.json
generated
60
package-lock.json
generated
@ -14,7 +14,7 @@
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"requires": {
|
||||
"balanced-match": "1.0.0",
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
@ -48,12 +48,12 @@
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
|
||||
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
|
||||
"requires": {
|
||||
"fs.realpath": "1.0.0",
|
||||
"inflight": "1.0.6",
|
||||
"inherits": "2.0.3",
|
||||
"minimatch": "3.0.4",
|
||||
"once": "1.4.0",
|
||||
"path-is-absolute": "1.0.1"
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"immediate": {
|
||||
@ -66,8 +66,8 @@
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"requires": {
|
||||
"once": "1.4.0",
|
||||
"wrappy": "1.0.2"
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
@ -85,11 +85,11 @@
|
||||
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.1.5.tgz",
|
||||
"integrity": "sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ==",
|
||||
"requires": {
|
||||
"core-js": "2.3.0",
|
||||
"es6-promise": "3.0.2",
|
||||
"lie": "3.1.1",
|
||||
"pako": "1.0.7",
|
||||
"readable-stream": "2.0.6"
|
||||
"core-js": "~2.3.0",
|
||||
"es6-promise": "~3.0.2",
|
||||
"lie": "~3.1.0",
|
||||
"pako": "~1.0.2",
|
||||
"readable-stream": "~2.0.6"
|
||||
}
|
||||
},
|
||||
"lie": {
|
||||
@ -97,7 +97,7 @@
|
||||
"resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz",
|
||||
"integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=",
|
||||
"requires": {
|
||||
"immediate": "3.0.6"
|
||||
"immediate": "~3.0.5"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
@ -105,7 +105,7 @@
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"requires": {
|
||||
"brace-expansion": "1.1.11"
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"once": {
|
||||
@ -113,7 +113,7 @@
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"requires": {
|
||||
"wrappy": "1.0.2"
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"os-tmpdir": {
|
||||
@ -141,12 +141,12 @@
|
||||
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz",
|
||||
"integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=",
|
||||
"requires": {
|
||||
"core-util-is": "1.0.2",
|
||||
"inherits": "2.0.3",
|
||||
"isarray": "1.0.0",
|
||||
"process-nextick-args": "1.0.7",
|
||||
"string_decoder": "0.10.31",
|
||||
"util-deprecate": "1.0.2"
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.1",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~1.0.6",
|
||||
"string_decoder": "~0.10.x",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"rimraf": {
|
||||
@ -154,7 +154,7 @@
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
|
||||
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
|
||||
"requires": {
|
||||
"glob": "7.1.3"
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"sax": {
|
||||
@ -167,10 +167,10 @@
|
||||
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.1.tgz",
|
||||
"integrity": "sha512-z88rdjHAv3jmTZ7KSGUkTvo4rGzcDGMq0oXWHNIDK96Gs31JKVdu9+FMtT4KBrVoibg8dUicJDok6GnqqttO5Q==",
|
||||
"requires": {
|
||||
"jszip": "3.1.5",
|
||||
"rimraf": "2.6.3",
|
||||
"jszip": "^3.1.3",
|
||||
"rimraf": "^2.5.4",
|
||||
"tmp": "0.0.30",
|
||||
"xml2js": "0.4.19"
|
||||
"xml2js": "^0.4.17"
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
@ -183,7 +183,7 @@
|
||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.30.tgz",
|
||||
"integrity": "sha1-ckGdSovn1s51FI/YsyTlk6cRwu0=",
|
||||
"requires": {
|
||||
"os-tmpdir": "1.0.2"
|
||||
"os-tmpdir": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"util-deprecate": {
|
||||
@ -201,8 +201,8 @@
|
||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
|
||||
"integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
|
||||
"requires": {
|
||||
"sax": "1.2.4",
|
||||
"xmlbuilder": "9.0.7"
|
||||
"sax": ">=0.6.0",
|
||||
"xmlbuilder": "~9.0.1"
|
||||
}
|
||||
},
|
||||
"xmlbuilder": {
|
||||
|
Loading…
Reference in New Issue
Block a user