import urllib2 import urllib import BeautifulSoup # "Obvious" constants url = 'http://www.cepstral.com/cgi-bin/demos/weather' # Here is the data that FireBug said we sent postdict = {'city' : 'San Francisco', 'demotype' : 'actual', 'state' : 'CA', 'voice' : 'David', 'submit':'Synthesize the weather'} # Encode it into HTTP form, blah de blah blah postme = urllib.urlencode(postdict) # Set up a request req = urllib2.Request(url=url, data=postme) # Send it... fd = urllib2.urlopen(url, postme) page = fd.read() # Find the WAV import re regex = re.compile(r'href="(.*wav)"') relative_url = regex.search(page).group(1) # Make it absolute import urlparse absolut_wav = urlparse.urljoin(url, relative_url) print absolut_wav # on Linux, I could run 'mplayer' on the resulting .wav file, and then it would play.