#!/usr/bin/env python
# --*-- coding:UTF-8 --*-- 

import sys, urllib2, urllib

consulta=sys.argv[1]
url='http://es.search.yahoo.com/search'
data=urllib.urlencode([('p',consulta)])
req=urllib2.Request(url)
fd=urllib2.urlopen(req,data)
file=open("resultado.html","w")
while 1:
	data=fd.read(1024)
	if not len(data):
		file.close()
		break
	file.write(data)
