I need save the HTML code of any website in a txt file, is a very easy exercise but I have doubts with this because a have a function that do this:
import ur
Easiest way would be to use urlretrieve:
import urllib urllib.urlretrieve("http://www.example.com/test.html", "test.txt")
For Python 3.x the code is as follows:
import urllib.request urllib.request.urlretrieve("http://www.example.com/test.html", "test.txt")