I've scraped a json from a LAN connection but I am unable to parse it through json.loads.
I'm trying to get all of the html from within the text lines, as you can see at the bottom.
I get the following error: ValueError: Expecting , delimiter: line 9 column 39 (char 222)
import json
import urllib2
##json_data = urllib2.urlopen("http://192.168.1.221:39285/set/json/sec", timeout=30).read()
json_data = """
{
"line_type":"Test",
"title":"Test",
"timestamp":"201310201628",
"line": [
{
"id":2,
"text": "<span class=\"prefix\">\n Result <\/span>\n \n" } , {
"id":1,
"text": "<span class=\"prefix\">\n Result <\/span>\n \n" } ]
}
"""
s = json.loads(r'{}'.format(json_data))
print s['line']
I want to be able to print: <span class=\"prefix\">\n Testing <\/span>\n \n
and <span class=\"prefix\">\n Test <\/span>\n \n
Any help would be much appreciated
I should of mentioned I'm looking for a regex or a workaround...