Created
April 17, 2019 16:40
-
-
Save loraxx753/c970bee5544149ff1f42a738b7e8b0a6 to your computer and use it in GitHub Desktop.
Scrapes the information from the info box on wikipedia pages
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
// Works on https://en.wikipedia.org/wiki/Electron. | |
(function() { | |
console.clear() | |
const response = {} | |
const values = [ ...document.querySelectorAll('.infobox td') ].slice(1).map(el => el.innerText) | |
;[ ...document.querySelectorAll('.infobox th') ].map(el => el.innerText.replace(/ /g, '')).map(keyText => { | |
response[keyText] = values.shift() | |
}) | |
return { ...response} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment