我正在使用Requests和BS4抓取一个网站,我提取了以下JSON(如果你可以称之为)。问题是它的格式不正确:
with open(data_file) as data:
next(data) #Are you sure you want this? It essentially throws away the first line
# of the data file
for line in data:
line = line.strip()
line = line.split()
output.write(line)
logging.info("Successfully added lines")
我有什么方法可以将JSON格式化为JSON标准吗?