Skip to content
Advertisement

Return Value in Console Window /w JavaScript [closed]

How can I use JavaScript in the web browser console window to return the value 159 from “playCount”:159 in an example like view-source:https://www.tiktok.com/@hvh_official_992/video/7104089332553714970? Tried the common steps, but this was too hard for me…

Advertisement

Answer

You can parse the JSON in SIGI_STATE

const json = document.getElementById("SIGI_STATE").textContent;
const obj = JSON.parse(json);
console.log(Object.values(obj.ItemModule)[0].stats.playCount)
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement