<p>You can use <code>ast.eval_literal()</code> within your json to make the "string formatted" list, be interpreted as a list and then reference it as you correctly stated.</p>

<p>Starting from your data, this worked for me:</p>

<pre><code>import ast
print(ast.literal_eval(data[0]['link'])[1]['href'])
</code></pre>

<p>Output:</p>

<pre><code>http://arxiv.org/pdf/1802.00209v1
</code></pre>
read the element from json file with python
<p>I'm new to read json file in python. I want to get the url from the file. Here is my json file. </p>

<pre><code>[
    {
        "author": "[{'name': 'Ahmed Osman'}, {'name': 'Wojciech Samek'}]",
        "day": 1,
        "id": "1802.00209v1",
        "link": "[{'rel': 'alternate', 'href': 'http://arxiv.org/abs/1802.00209v1', 'type': 'text/html'}, {'rel': 'related', 'href': 'http://arxiv.org/pdf/1802.00209v1', 'type': 'application/pdf', 'title': 'pdf'}]",
        "month": 2,
        "summary": "We propose an architecture for VQA which utilizes recurrent layers to\ngenerate visual and textual attention. The memory characteristic of the\nproposed recurrent attention units offers a rich joint embedding of visual and\ntextual features and enables the model to reason relations between several\nparts of the image and question. Our single model outperforms the first place\nwinner on the VQA 1.0 dataset, performs within margin to the current\nstate-of-the-art ensemble model. We also experiment with replacing attention\nmechanisms in other state-of-the-art models with our implementation and show\nincreased accuracy. In both cases, our recurrent attention mechanism improves\nperformance in tasks requiring sequential or relational reasoning on the VQA\ndataset.",
        "tag": "[{'term': 'cs.AI', 'scheme': 'http://arxiv.org/schemas/atom', 'label': None}, {'term': 'cs.CL', 'scheme': 'http://arxiv.org/schemas/atom', 'label': None}, {'term': 'cs.CV', 'scheme': 'http://arxiv.org/schemas/atom', 'label': None}, {'term': 'cs.NE', 'scheme': 'http://arxiv.org/schemas/atom', 'label': None}, {'term': 'stat.ML', 'scheme': 'http://arxiv.org/schemas/atom', 'label': None}]",
        "title": "Dual Recurrent Attention Units for Visual Question Answering",
        "year": 2018
    },
    {
        "author": "[{'name': 'Ji Young Lee'}, {'name': 'Franck Dernoncourt'}]",
        "day": 12,
        "id": "1603.03827v1",
        "link": "[{'rel': 'alternate', 'href': 'http://arxiv.org/abs/1603.03827v1', 'type': 'text/html'}, {'rel': 'related', 'href': 'http://arxiv.org/pdf/1603.03827v1', 'type': 'application/pdf', 'title': 'pdf'}]",
        "month": 3,
        "summary": "Recent approaches based on artificial neural networks (ANNs) have shown\npromising results for short-text classification. However, many short texts\noccur in sequences (e.g., sentences in a document or utterances in a dialog),\nand most existing ANN-based systems do not leverage the preceding short texts\nwhen classifying a subsequent one. In this work, we present a model based on\nrecurrent neural networks and convolutional neural networks that incorporates\nthe preceding short texts. Our model achieves state-of-the-art results on three\ndifferent datasets for dialog act prediction.",
        "tag": "[{'term': 'cs.CL', 'scheme': 'http://arxiv.org/schemas/atom', 'label': None}, {'term': 'cs.AI', 'scheme': 'http://arxiv.org/schemas/atom', 'label': None}, {'term': 'cs.LG', 'scheme': 'http://arxiv.org/schemas/atom', 'label': None}, {'term': 'cs.NE', 'scheme': 'http://arxiv.org/schemas/atom', 'label': None}, {'term': 'stat.ML', 'scheme': 'http://arxiv.org/schemas/atom', 'label': None}]",
        "title": "Sequential Short-Text Classification with Recurrent and Convolutional\n  Neural Networks",
        "year": 2016
    }
]
</code></pre>

<p>I read the file by using the code as follow.</p>

<pre><code>with open(args.filename, 'r') as myfile:
    data = json.loads(myfile.read())
    myfile.close()
</code></pre>

<p>And I wanted to get the second <code>href</code> by using <code>data[0]["link"][1]["href"]</code>. However the type of <code>data[0]["link"]</code> is string. I wonder how I can deal with this.</p>