Re: Need help to figure out urllib2.Request()

2008-02-18 Thread Gabriel Genellina
En Mon, 18 Feb 2008 09:21:10 -0200, James Yu <[EMAIL PROTECTED]> escribi�: > Hi folks, > > I tried to open some web pages with urllib2.Request(url, data, headers), > but > it always give me a 404 error. > Eg. > url = 'http://www.whatever.com/somephp.php' > data = {} > data['id'] = account > for

Need help to figure out urllib2.Request()

2008-02-18 Thread James Yu
Hi folks, I tried to open some web pages with urllib2.Request(url, data, headers), but it always give me a 404 error. Eg. url = 'http://www.whatever.com/somephp.php' data = {} data['id'] = account for i in book2Open: data['book'] = i url_data = urllib.urlencode(data) request = urllib2.