You have not escaped the slash in your regular expression. Change the regex:
<span id="yfs_l84_%s">(.+?)</span>
to
<span id="yfs_l84_goog">(.+?)<\/span>
This will fix your problem if you enter the company listing code as an input code. Ex; goog for google.
, , . , BeautifulSoup, Python HTML. BeautifulSoup , :
from bs4 import BeautifulSoup
import requests
name = raw_input('>')
url = 'http://finance.yahoo.com/q?s={}'.format(name)
r = requests.get(url)
soup = BeautifulSoup(r.text)
data = soup.find('span', attrs={'id':'yfs_l84_'.format(name)})
print data.text