S
S
Skylead2016-09-21 19:30:34
Python
Skylead, 2016-09-21 19:30:34

How to make JSON "normal"?

Greetings.
How to get rid of unnecessary characters in JSON?

])}while(1);</x>{"key1":true,"key2":{"key3":[{"key4"....

In the fidler it looks normal in the JSON tab
. In the JSON viewer plugin you click on "Strip to{}" and everything looks normal.
How do you actually implement this in python?
874889609ce447049395760293fd7e46.PNG
How do you actually implement this in python?
UPD:
import requests
import  json

url = 'https://site.com'
r = requests.get(url, verify = False)
j = r.text
js = j.replace('])}while(1);</x>','')
json = json.loads(js)
print(json)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2016-09-21
@dimonchik2013

the file does not exist in Jason, it is a regular formatted text file, look for the reason where the file comes from

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question