Truoble With A Search Script for ImageBin.org

Brandon Conner brandonc530 at gmail.com
Fri Mar 19 02:00:47 CET 2010


Hey Pythoners,

its my first post here, yay!

I'm trying to develop a script that will return the results of a POST
request that should list all images uploaded by a user.  However, when i run
the script, i get returned the HTML of the page with the search form.  I am
wondering what am i doing incorrectly?  Is it something I'm doing or is the
imagebin server rejecting my request?

here's the code:

import urllib
import urllib2
url = 'http://imagebin.org/index.php?page=search'
values = {'search_for' : 'blah', 'field' : 'Nickname'}
data = urllib.urlencode(values)
request = urllib2.Request(url, data)
response = urllib2.urlopen(request)
page = response.read()
print page

tks, pythons great
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100318/c3f52ef2/attachment.html>


More information about the Python-list mailing list