Skip to content
Advertisement

Writing Dictionaries into a CSV

I am working on a web scraping project, I am trying to save the results into a CSV file,

JavaScript

I want to save the key in the dictionary as columns and the values as a row, (keep in mind that the value pair in the dictionary refers to a variable that extracts data from a web site)

Advertisement

Answer

Here is a solution that can work for you. I added a second data item to your code (data2) and renamed the initial data element to data1.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement