I know I have seen the answer somewhere a couple of weeks ago but I can't find it now.
Simple urllib.urlretrieve
in Python 3.3. How do you do it? I'm trying to download an mp4/html(Page does not exist) scenario, either the page if it does not exist or the mp4 if it does(I can delete the file if the file size is to small or keep it otherwise).
The code I have runs fine and does exactly what I want it to do in 2.7, but it doesn't work in 3.3.
I'm dealing with both giving me headaches, Tkinter and urllib between the two version of Python. Tkinter works fine in 3.3, but urllib doesn't and urllib works fine in 2.7 but Tkinter doesn't. How do I get this to download correctly in 3.3?
I know 3.3 has changed the urllib but I can't find what I saw a week or two ago to guide me in the correct direction.
2.7 does pretty much nothing when I add the Tkinter change over in and 3.3 just comes up and gives me urllib doesn't have an attribute 'urlretrieve;. I prefer 3.3.
import urllib.request
followed byurllib.request.urlretrieve
. It doesn't function the same. Instead of coming up and downloading the html file that by its size tells me that it isn't the mp4 file I'm looking for instead it keeps coming up and giving me HTTTPError: HTTP Error 404 Not Found. In 2.7 it downloads the html file that I delete, in 3.3 it just flags me back the error. Is there a way around that? – confused Jan 16 '14 at 20:23urllib.request
in but I wasn't doing it asfrom urllib.request import urlretrieve
just insteadimport urllib.request
. Like I said at the beginning I knew I had seen somewhere the change but couldn't remember what the change was. With that being changed I still get the 'urllib is not defined error'. – confused Jan 16 '14 at 20:59