To solve Valid JSON giving JSONDecodeError: Expecting , delimiter error follow below methods.
ERROR LOG
ValidJSONDecodeError: Expecting , delimiter: line 1 column 23 (char 23)
Contents
How to solve Valid JSON giving JSONDecodeError: Expecting , delimiter ?
Refer the given methods to solve the issue.
Method 1:
You’ll need place a r
before “””, or replace all \
with \\
. This isn’t something to worry about if you’re reading json from somewhere else; it’s something to do with the string itself.
data = json.loads(r"""{ "entry":{ "etag":"W/\"A0UGRK47eCp7I9B9WiRrYU0.\"" } }""")
Method 2 :
st = r'{ "entry":{ "etag":"W/\"A0UGRK47eCp7I9B9WiRrYU0.\"" } }'
data = json.loads(st)
Hope the above solution works.
Also read :
AttributeError: ‘str’ object has no attribute ‘append’