Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Json decoding error
#1
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
Reply
#2
show code
Reply
#3
(Jul-23-2018, 03:55 PM)Larz60+ Wrote: show code
It is not possible to show code. Can you help me without code
Reply
#4
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 :)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Error when decoding JSON ( Expecting ',' delimiter:) tortoise 7 46,939 Feb-18-2019, 08:27 AM
Last Post: tortoise
  500 error cannot deserialize json object SaiBhargav 0 2,776 Sep-18-2018, 09:53 PM
Last Post: SaiBhargav
  Decoding html to text string PeterPython 1 2,632 Aug-12-2018, 07:23 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020