0

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?

Parfait
  • 104,375
  • 17
  • 94
  • 125
  • possible duplicate - http://stackoverflow.com/questions/8814802/python-errno-10054-an-existing-connection-was-forcibly-closed-by-the-remote-h – gaganso Jun 02 '16 at 18:33
  • Works fine for me, it could be a multitude of reasons it did not work for you including network or server issues. – Padraic Cunningham Jun 03 '16 at 00:41
  • The link when clicked works fine but doesn't work within the program. Any ideas on what is the issue? – user1469502 Jun 07 '16 at 12:22

0 Answers0