Python Forum

Full Version: Json decoding error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
While using requests module i got a response from server which i passed into json. Loads().THe input to json.loads here is a string in html format. Now when json.loads executes i am getting a error “No json object could be decided”. The same error does not occur when input is string in json format.how to avoid the error in first case
show code
(Jul-23-2018, 03:55 PM)Larz60+ Wrote: [ -> ]show code
It is not possible to show code. Can you help me without code
Whatever you're getting from the server isn't valid json. Because it isn't valid, the json module can't parse it.

(Jul-23-2018, 02:48 PM)saisankalpj Wrote: [ -> ]THe input to json.loads here is a string in html format
If this is accurate, then that's your issue. HTML is not json. A json parser won't understand html. Try BeautifulSoup instead :)