At the following url...

http://docs.python.org/library/urllib2.html

They have the following...

"urllib2.urlopen(url[, data][, timeout])

    Open the URL url, which can be either a string or a Request
object"

I don't get how urllib2.urlopen() can take a Request object. When I do
the following....

[cdal...@localhost ~]$ python
Python 2.4.3 (#1, Oct  1 2006, 18:00:19)
[GCC 4.1.1 20060928 (Red Hat 4.1.1-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib2
>>>
>>> url = 'http://www.google.com'
>>> req = urllib2.Request(url)
>>> response = urllib2.urlopen(req)
>>>

req is clearly an instance of urllib2.Request and not a Request object.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to