Json decoding error - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: Json decoding error (/thread-11728.html) |
Json decoding error - saisankalpj - Jul-23-2018 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 RE: Json decoding error - Larz60+ - Jul-23-2018 show code RE: Json decoding error - saisankalpj - Jul-23-2018 (Jul-23-2018, 03:55 PM)Larz60+ Wrote: show codeIt is not possible to show code. Can you help me without code RE: Json decoding error - nilamo - Jul-23-2018 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 formatIf this is accurate, then that's your issue. HTML is not json. A json parser won't understand html. Try BeautifulSoup instead :) |