Unable to download XML file using python (Error 10054)
<p>I am trying to download an XML file.</p>

<p>The code is as follows:</p>

<pre><code>import re
import urllib
import datetime
from bs4 import BeautifulSoup

link = "https://www.gpo.gov/fdsys/granule/FR-2016-06-02/2016-12978/mods.xml"
italink = urllib.urlopen(link).read()
soup = BeautifulSoup(italink)
print soup
</code></pre>

<p><strong>And get the following error:</strong></p>

<blockquote>
  <p>IOError: [Errno socket error] [Errno 10054] An existing connection was forcibly closed by the remote host</p>
</blockquote>

<p>What should I do to download the file successfully?</p>