Download the value of the returned json file to the file

the json returned by requests is in the form of dictionary data: [{aburel _ 1}, {aburel _ 2}, {ab _ 2}.], how to download the values of all ab columns into csv files in turn and save them in two columns.

Oct.27,2021

for item in data:
    with open('test.csv', 'w') as f:
        f.writeline('${},${}\n'.format(item[a],item[b]))

has not been verified, but it is almost meaningful


pandas has a read_json function, which can read the json string whose orient is records into the data frame and save it as a csv file in to_csv. You can try.

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-1eb0b02-22fc.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-1eb0b02-22fc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?