Just adding onto alexce's response, you can easily convert the restructured data into JSON:

import json
json.dumps(result)

There are some potential security concerns with top-level arrays. I'm not sure if they're still valid with modern browsers, but you may want to consider wrapping it in an object.

import json
json.dumps({'results': result})
Answer from ngraves on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ gloss_python_convert_into_JSON.asp
Python Convert From Python to JSON
Remove List Duplicates Reverse ... ... If you have a Python object, you can convert it into a JSON string by using the json.dumps() method....
๐ŸŒ
Wtools
wtools.io โ€บ convert-list-to-json-array
Convert List to JSON Array Online - wtools.io
Free tool for online converting text list into appropriate JSON type as Array, generate JSON array from list quickly.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ convert-python-list-to-json
Convert Python List to Json - GeeksforGeeks
July 23, 2025 - In this example, a Python list containing a mix of integers and strings (list_1) is converted to a JSON-formatted string (json_str) using json.dumps().
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_json.asp
Python JSON
Remove List Duplicates Reverse a String Add Two Numbers ยท Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... JSON is a syntax for storing and exchanging data. JSON is text, written with JavaScript object notation. Python has a built-in package called json, which can be used to work with JSON data.
๐ŸŒ
Appdividend
appdividend.com โ€บ python-list-to-json
How to Convert List to JSON in Python (Variables and Files)
November 24, 2025 - The most efficient and straightforward way to convert a Python List is by using the json.dumps() method.
๐ŸŒ
AskPython
askpython.com โ€บ home โ€บ convert a list to json string in python [easy step-by-step]
Convert a List to JSON String in Python [Easy Step-By-Step] - AskPython
May 30, 2023 - The dumps() function takes a Python list as its parameter, converts it into a JSON string, and then returns that JSON string. The syntax for using the dumps() function is given below.
๐ŸŒ
Python Examples
pythonexamples.org โ€บ python-list-to-json
Python List to JSON
To convert a Python List to JSON, use json.dumps() function. dumps() function takes list as argument and returns a JSON String. In this tutorial, we have examples to demonstrate different scenarios where we convert a given list to JSON string.
Find elsewhere
๐ŸŒ
Spark By {Examples}
sparkbyexamples.com โ€บ home โ€บ python โ€บ convert python list to json examples
Convert Python List to JSON Examples - Spark By {Examples}
March 27, 2024 - How to convert a list to JSON in Python? You can use the json.dumps() method to convert a Python list to a JSON string. This function takes a list as an argument and returns the JSON value.
Top answer
1 of 4
3

One by one access each element from list and put it into some dict and at the end append to a list:

import json

# some example lists
em_link = ['a', 'b', 'c']
em_title = ['x', 'y', 'z']
em_desc = [1,2,3]

arr = []
for i,j,k in zip(em_link, em_title, em_desc):
    d = {}
    d.update({"link": i})
    d.update({"title": j})
    d.update({"desc": k})
    arr.append(d)

print(json.dumps(arr))

Output:

[{"link": "a", "title": "x", "desc": 1}, {"link": "b", "title": "y", "desc": 2}, {"link": "c", "title": "z", "desc": 3}]
2 of 4
3

This returns an array of JSON objects based off of Chandella07's answer.

from bs4 import BeautifulSoup
import pandas as pd
import requests
import json

r = requests.get("https://www.emojimeanings.net/list-smileys-people-whatsapp")

soup = BeautifulSoup(r.text, "lxml")

emojiLinkList = []
emojiTitleList = []
emojiDescriptionList = []
jsonData = []

for tableRow in soup.find_all("tr", attrs={"class": "ugc_emoji_tr"}):
    for img in tableRow.findChildren("img"):
        emojiLinkList.append(img['src'])

for tableData in soup.find_all("td"):
    for boldTag in tableData.findChildren("b"):
        emojiTitleList.append(boldTag.text)

for tableRow in soup.find_all("tr", attrs={"class": "ugc_emoji_tr"}):
    for tabledata in tableRow.findChildren("td"):
        if tabledata.has_attr("id"):
            k = tabledata.text.strip().split('\n')[-1]
            l = k.lstrip()
            emojiDescriptionList.append(l)

for link, title, desc in zip(emojiLinkList, emojiTitleList, emojiDescriptionList):
    dict = {"link": link, "title": title, "desc": desc}
    jsonData.append(dict)

print(json.dumps(jsonData, indent=2))

Data Example:

{
    "link": "https://www.emojimeanings.net/img/emojis/purse_1f45b.png",
    "title": "Wallet",
    "desc": "After the shopping trip, the money has run out or the wallet was forgotten at home. The accessory keeps loose money but also credit cards or make-up. Can refer to shopping or money and stand for femininity and everything girlish."
  },
๐ŸŒ
Quora
quora.com โ€บ How-do-I-convert-a-list-to-JSON-in-Python
How to convert a list to JSON in Python - Quora
Use json.dump to stream directly to a file. with open("data.json", "w", encoding="utf-8") as f: json.dump(py_list, f, ensure_ascii=False, indent=2) Options: indent formats output, ensure_ascii=False preserves non-ASCII characters.
๐ŸŒ
DataCamp
datacamp.com โ€บ tutorial โ€บ json-data-python
Python JSON Data: A Guide With Examples | DataCamp
December 3, 2024 - While Python is capable of storing intricate data structures such as sets and dictionaries, JSON is limited to handling strings, numbers, booleans, arrays, and objects. Letโ€™s look at some of the differences: To convert a Python list to JSON format, you can use the json.dumps() method from ...
๐ŸŒ
Finxter
blog.finxter.com โ€บ 5-best-ways-to-convert-a-python-list-to-json
5 Best Ways to Convert a Python List to JSON โ€“ Be on the Right Side of Change
February 20, 2024 - This snippet creates a pandas Series from a list of fruits and then converts it to a JSON string using the to_json() method of Series. Notice that the output JSON string includes index-value pairs. The json.JSONEncoder class provides a customizable way to convert Python lists (and other objects) ...
๐ŸŒ
Linux Hint
linuxhint.com โ€บ python-list-to-json
Python List to JSON
October 20, 2021 - Linux Hint LLC, [email protected] 1210 Kelly Park Circle, Morgan Hill, CA 95037 Privacy Policy and Terms of Use
๐ŸŒ
Medium
medium.com โ€บ @wepypixel โ€บ how-to-convert-a-list-to-json-python-simple-technique-pypixel-c329f6de5d7a
How to Convert a List to JSON Python? Simple Technique -PyPixel | by Stilest | Medium
August 26, 2023 - This module provides methods to serialize Python objects into JSON format and deserialize JSON data back into Python objects. Here's a step-by-step guide: First, we will be importing Pythonโ€™s in-built json module into your Python script by adding this line of code: ... Now just for an example, we will create a dummy list that we will further use to convert the list to JSON in Python:
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-convert-list-of-dictionaries-to-json
Python - Convert list of dictionaries to JSON - GeeksforGeeks
July 5, 2025 - The default parameter in json.dumps() helps serialize non-serializable data types. You can pass a lambda function to convert types like tuples to lists.
๐ŸŒ
Finxter
blog.finxter.com โ€บ 5-best-ways-to-convert-a-python-list-to-a-json-file
5 Best Ways to Convert a Python List to a JSON File โ€“ Be on the Right Side of Change
February 20, 2024 - The json.dump() function is a simple and direct way to convert a Python list to a JSON file. It writes the Python list as a JSON formatted stream to the specified file.
๐ŸŒ
Medium
medium.com โ€บ @zeebrockeraa โ€บ how-to-convert-python-list-to-json-3a0485f39c7e
How to convert Python List to JSON - Zeeshan Ali - Medium
July 12, 2023 - my_list = [1, 2, 3, 4, 5]# Convert the list to JSON format json_data = json.dumps(my_list)print(json_data) In the code above, we import the json module and create a Python list called my_list containing some elements. Then we use the json.dumps() ...