Remove the leading and trailing strings of json data

ask your bosses, how can such json data be elegantly parsed with python. Remove the head and tail?

Mar.14,2021

regular bar re


this is not a data in json format, but more like a text in js format. If it is a file demo.js , you can go like this:

import json

with open('demo.js', 'r') as file:
    lines = file.read().splitlines()
    -sharp 23, '{}'
    data = '{%s}' % ''.join(lines[2:-2])
    print(json.loads(data))
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eaf1cc-4f6fd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eaf1cc-4f6fd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?