Вот скрипт:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib, urllib2, re
yapages = urllib2.Request('http://m.yandex.ru/')
yapages = urllib2.urlopen(yapages)
yapages_cookie = unicode(yapages.headers['Set-Cookie'], 'utf-8')
yapages_cookie = re.findall('yandexuid=(.*?);', yapages_cookie)
yapages_cookie = yapages_cookie[0]
url = 'http://yandex.ru'
url = url.replace("http://","")
url = url.replace("/","")
yapages = urllib2.Request('http://m.yandex.ru/msearch?text=host:'+str(url)+'+|+host:www.'+str(url)+'&lr=42')
yapages.add_header("Accept", 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
yapages.add_header('Accept-Charset', 'utf-8;q=0.7,*;q=0.7')
yapages.add_header('Accept-Encoding', '')
yapages.add_header('Accept-Language', 'ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3')
yapages.add_header('Connection', 'keep-alive')
yapages.add_header('Cookie', 'yandexuid='+str(yapages_cookie)+';')
yapages.add_header('Referer', 'http://google.com/')
yapages.add_header('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 YB/6.5.1')
yapages = urllib2.urlopen(yapages).read()
#yapages = urllib.urlopen('http://yandex.ru/yandsearch?text=host:'+str(url)+'+|+host:www.'+str(url)+'&lr=42').read()
yapages = yapages.replace("\n","")
yapages = yapages.replace("\r","")
yapages = re.findall('<title>(.*?)</title>', yapages)
yapages = str(yapages[0]).decode('utf-8')
yapages = yapages.replace(' млн'.decode('utf-8'),'000000')
yapages = yapages.replace(' тыс.'.decode('utf-8'),'000')
yapages = yapages.replace(' ','')
print yapages