URL Openers
eharetea

Open up a url and send commands using Python.

URL openers!

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Friday August 01st, 2008 02:09 AM

# opens a url directly:

import urllib
f = urllib.urlopen("http://sesi.3daet.com/?base=14")
print f.read()



# specifiying GET parameters:

import urllib
params = urllib.urlencode({'base' : 14, 'cat' : 316, 'demo' : 319})
f = urllib.urlopen("http://sesi.3daet.com/?%s" % params)
print f.read()



# specifiying POST parameters:

import urllib
params = urllib.urlencode({'base' : 14, 'cat' : 316, 'demo' : 319})
f = urllib.urlopen("http://sesi.3daet.com/" params)
print f.read()