Saving a webpage to text file
As a review, the code needs some work with regard separation of concerns. A single function shouldn't get user input, get a URL and write to a file. If you try to write unit tests for it, you'll quickly see it's better to split the functionality.

With regard to the problem, try something as follows:

import urllib2

url = 'http://www.uniprot.org/uniprot/P57052.txt'
response = urllib2.urlopen(url)
with open('output.txt', 'w') as f:
    f.write(response.read())


I hope this helps.