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 :
import requests
from bs4 import BeautifulSoup
import json
import codecs
URL = "https://quranromanurdu.com/chapter/1"
page = requests.get(URL)
soup = BeautifulSoup(page.content, "html.parser")
table = soup.findAll('div',attrs={"id":"contentpara"})
data0 = json.loads(table)
print(data0)
Error
line 24, in <module>
data0 = json.loads(table)
File "C:\Users\arbazalx\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not ResultSet