I am trying to download an XML file.
The code is as follows:
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
And get the following error:
IOError: [Errno socket error] [Errno 10054] An existing connection was forcibly closed by the remote host
What should I do to download the file successfully?