urllib redirect problem/bug?

Ragu Bharadwaj Ragu.Bharadwaj at amphoracorp.com
Fri Feb 21 16:52:40 EST 2003


The code (assuming the mailer doesn't botch formatting)

import urllib
import urllib
params = urllib.urlencode({'LDAP__keyword' : 'TCPTP',
                           'Display__numResults' : 'All',
                           'Display__sortField' : 'Date',
                           'Display__order' : 'descending'})    
urllib.urlretrieve('http://www.rcsb.org/pdb/cgi/resultBrowser.cgi',
'TCPTP.html', data=params)


on execution yields a HTML error 405 (method not allowed) page in
TCPTP.html instead to redirecting to

http://www.rcsb.org/pdb/cgi/explore.cgi?pid=119651045863797&pdbId=1L8K

When I try the same with Java's HTTPUrlConnection class I am
redirected to the  correct page required with no problems. Am I doing
something wrong here or is this a known redirection bug in urllib?

cheers
-Ragu




More information about the Python-list mailing list