python3: Read json file from url
<p>In python3, I want to load <a href="https://www.govtrack.us/data/congress/113/votes/2013/s11/data.json" rel="nofollow">this_file</a>, which is a json format.</p>

<p>Basically, I want to do something like [pseudocode]:</p>

<pre><code>&gt;&gt;&gt; read_from_url = urllib.some_method_open(this_file)
&gt;&gt;&gt; my_dict = json.load(read_from_url)
&gt;&gt;&gt; print(my_dict['some_key'])
some value
</code></pre>

<p>So you want to be able to reference specific values with inputting keys? If i think i know what you want to do, this should help you get started. You will need the libraries urlllib2, json, and bs4. just pip install them its easy.</p>

<pre><code>import urllib2
import json
from bs4 import BeautifulSoup

url = urllib2.urlopen("https://www.govtrack.us/data/congress/113/votes/2013/s11/data.json")
content = url.read()
soup = BeautifulSoup(content, "html.parser")
newDictionary=json.loads(str(soup))
</code></pre>

<p>I used a commonly used url to practice with.</p>

python json url