I'm currently teaching myself python (coming from no programming background, but a lot of sys admin, scripting experience) and have gone about creating a script/program that looks at a site and grabs all the images. I've struggled quite a bit but I've gotten it working to an extent.
Now, my current issue is that when I do urllib.urlretrieve(url, out_path) on a url like: http://www.testsite.com/images/img.jpg
- it works fine but something like http://www.testsite.com/../images/img.jpg
doesn't work. When you hit that path in your browser it works fine, and urllib.urlretrieve retrieves the images but it's broken when you try and open it in an image viewer.
This is my code currently:
http://pastebin.com/E9hutEGn - sorry for the pastebin post, the code was a bit too much and I didn't want to make the post read badly.
Can anyone recognize why it isn't working?