Does anyone know of any good urllib tutorials other than
http://www.voidspace.org.uk/python/articles/urllib2.shtml#introduction & http://effbot.org/librarybook/urllib.htm. Something which a little beginner friendly:| with good explanations.

-Thanks

Recommended Answers

All 3 Replies

This one helped me a bit
http://cis.poly.edu/cs912/parsing.txt

thanks mn_kthompson but thats a bit beyond me for the moment:) . Are there any other tutorials where it shows how to download files, fill in forms, send messages etc?.

----
My computer froze when i did this, LOL:D (was just messing about)

import urllib2
dload = urllib2.Request ('http://www.shadowbox.110mb.com/images/ShadowBox.png')
open = urllib2.urlopen (dload)
png = open.read()
print png

Yeah, I probably shouldn't have given you that link. It is really more about parsing the html that you get rather than the intricacies of urllib.

One of the first things I would look at is this link. http://www.velocityreviews.com/forums/t326690-urllib-urllib2-what-is-the-difference-.html
It was helpful for me to understand the difference between urllib and urllib2 and what each can do. It's short, but simple.

Then check out the end of this page. http://docs.python.org/library/urllib.html It has a few examples of how to do simple stuff.

Unfortunately, my knowledge of urllib does not go beyond the simple...but I was able to make your code work. Check this out...

import urllib
pngfile = urllib.urlopen('http://www.shadowbox.110mb.com/images/ShadowBox.png')
filetowrite = open('ShadowBox.png','w')
filetowrite.write(pngfile.read())
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.