Skip to content
Advertisement

I’m getting error when trying to convert Html to JSON using python with beautiful soup

I’m trying to scrap data from this website “https://quranromanurdu.com/chapter/1” , I want only text or content from id-contentpara and return that content in JSON format, this below code gives html content but i want that to convert to JSON. I tried to convert but I’m getting error , please somebody help me to clear this error

python code :

JavaScript

Error

JavaScript

Advertisement

Answer

You can do like this,

JavaScript

Output:

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