11 lines
527 B
JavaScript
11 lines
527 B
JavaScript
const fs = require('fs')
|
|
const html = fs.readFileSync('D:/Sites/Skinbase26/skinbase.top-20260429T075355.html', 'utf8')
|
|
const idx = html.indexOf('"requestedUrl"')
|
|
let start = idx; while(start>0 && html[start]!=='{') start--
|
|
let depth=0,end=0
|
|
const slice = html.slice(start)
|
|
for(let i=0;i<slice.length;i++){if(slice[i]==='{')depth++;else if(slice[i]==='}'){depth--;if(depth===0){end=i+1;break}}}
|
|
const lhr = JSON.parse(slice.slice(0,end))
|
|
const lcp = lhr.audits['lcp-discovery-insight']
|
|
console.log(JSON.stringify(lcp, null, 2))
|