Below is part of my code that is giving me error..
# get all browser products
raw_json_file = open( script_dir + "raw_json.js", 'r' )
raw_json = raw_json_file.read()
all_str = raw_json[ raw_json.find("{"): ]
all_obj = json.loads(all_str)
browser_products = all_obj["categories"]["6"]["products"]
the error I am getting here is as below:
C:\Python34>python parse.py 8.3.4
argument is 8.3.4
Traceback (most recent call last):
File "parse.py", line 42, in <module>
raw_json = raw_json_file.read()
File "C:\Python34\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 563011: character maps to <undefined>
Please let me know how to solve this error.
jsfiles are javascript.jsonis a json file.