alzayani / GsmArena specifications to Json Spec

// ==UserScript==
// @name         GsmArena specifications to Json Spec
// @namespace    http://gsmarena.com/
// @version      0.1
// @description  run on the current phone specifications page and save the specifications as json to "spec" var
// @author       Alzayani
// @match        https://www.gsmarena.com/*.php
// @grant        none
// @copyright 2019, alzayani (https://openuserjs.org/users/alzayani)
// @license MIT
// ==/UserScript==

window.spec=[...document.querySelectorAll(".nfo")].reduce((m,x,i,n) => ( m[((n.pe=x.previousElementSibling.previousElementSibling || n.pe).textContent + " " + x.previousElementSibling.textContent).trim()] =  x.textContent,m), {});
console.log("spec",window.spec);