Python remove @ attribute xml to json converter


url = "https://data.bmkg.go.id/datamkg/MEWS/DigitalForecast/DigitalForecast-KalimantanTimur.xml" 
response = requests.get(url) 
data = xmltodict.parse(response.content, attr_prefix='', cdata_key='text') 

datajson = (data['data']['forecast']['area'][1]['parameter'][6]['timerange'])

return print(json.dumps())

Advertisement

Published by

susiloharjo

Khoirunnas anfa'ahum linnas A Father, Husband and love to learn person Love my Family, Electronics, Photography, Robot, Dreaming, Programming

Ditunggu komennya ...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.