i_saw_some 0 Newbie Poster

Hi,

Does anyone know how to perform web queries programmatically from Python with GET and Post requests? I have been trying out my code on this site - http://www.comp.leeds.ac.uk/Perl/Cgi/textareas.html

import urllib, urllib2

link = 'http://www.comp.leeds.ac.uk/Perl/Cgi/textareas.html'
urldata = {'review':"test",'method':'GET'}
data = urllib.urlencode(urldata)
req = urllib2.Request(link, data)
response = urllib2.urlopen(req)
the_page = response.read()
print the_page, req.get_full_url()

However, I don't get the right web page back. What did I do wrong? Did I use the wrong key, value pairs? What should they be?

Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.