save into json

# save files in json format

import json

for url in crawlList:
    articleID = url.split("/")[-1]
    extractedData = ArticleDataExtractor(url)
    
    my_filename = 'data/' + str(articleID) + '.json'
    with open(my_filename, 'w') as fp:
        json.dump(extractedData, fp, indent = 4)

Send a Comment

Your email address will not be published.