I'm receiving a json file that begins with : 'b\'{ "key" : ....
I'm attempting to remove the 'b\'
part of the string as it's not valid json.
The json is read using :
import urllib.request
link = "http://www...."
with urllib.request.urlopen(link) as url:
s = str(url.read())
My code to replace is : replace('\'b\'', '')
but the string 'b\'{ "key" : ....
remains instead of { "key" : ....
Attempting to recreate the issue excluding the json string :
mystr = ' b\'{ '
mystr.replace(' b\'{ ', '')
successfully replaces as ' '
is the output.