<select class="input_large_300 country_select" id="country_id" name="country[country_id]"> <option value=""></option> <option value="106">US</option> <option value="280">Mexico</option> <option value="399">Canada</option>
I'm using the following code to post:
mydata = [('country_id', '399')]
mydata = urllib.urlencode(mydata)
path = 'http://www.somewebsite.com/submitted'
myheader = ["Content-type: application/x-www-form-urlencoded"]
pycurl_con.setopt(pycurl.POSTFIELDS, mydata)
pycurl_con.setopt(pycurl.HTTPHEADER, myheader)
storage = StringIO()
pycurl_con.setopt(pycurl.URL, path)
pycurl_con.setopt(pycurl.PROXY, 'localhost') # Assuming Tor is on the same machine
pycurl_con.setopt(pycurl.PROXYPORT, 9050) # The port Tor runs through
pycurl_con.setopt(pycurl.PROXYTYPE, pycurl.PROXYTYPE_SOCKS5)
pycurl_con.setopt(pycurl.WRITEFUNCTION, storage.write)
pycurl_con.perform()
pycurl_con.close()
Like I said, this code works for posting when I'm not dealing with drop down lists. Is there something wrong with what I have here? And does anyone know of any websites that have a large number of examples of posting with pycurl in many different scenarios?
Any help would be appreciated. Thanks!

New Topic/Question
Reply



MultiQuote


|