On Sat, Oct 18, 2008 at 12:26 PM, xbmuncher <[EMAIL PROTECTED]> wrote:
> Apparently, the right
> page was a redirection of the original page. When I used to use cURL in PHP
> I remember that it had an option to automatically follow redirects. How can
> I do this with urllib2?

urllib2 will follow HTTP redirects (30x status codes). It won't follow
redirects in <meta> tags or JavaScript. The fetch_html() function here
will follow some <meta> redirects:
http://code.google.com/p/blogmaker/source/browse/trunk/blogmaker/util/fetch.py

> For the headers, I did verify that it sent the headers as I had formed them
> (just not in the right order) with wireshark. So my method does work, I also
> got this method from here:
> http://www.voidspace.org.uk/python/articles/urllib2.shtml#headers

OK. I have definitely had trouble with that in the past but maybe it
is fixed now.

Kent
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to