code: def get_type(symbol):
      '''
      Uses BeautifulSoup to scrape symbol category from Yahoo! Finance website
      '''
      url = 'http://finance.yahoo.com/q/pr?s=%s+Profile' % symbol
      soup = BeautifulSoup(urlopen(url).read())
      if soup.find('span', text='Business Summary'):
          return 'Stock'
      elif soup.find('span', text='Fund Summary'):
          asset_type = 'Fund'
      elif symbol.find('^') == 0:
          asset_type = 'Index'
      else:
          pass
      return asset_typf get_type(symbol):
      '''
      Uses BeautifulSoup to scrape symbol category from Yahoo! Finance website
      '''
      url = 'http://finance.yahoo.com/q/pr?s=%s+Profile' % symbol
      soup = BeautifulSoup(urlopen(url).read())
      if soup.find('span', text='Business Summary'):
          return 'Stock'
      elif soup.find('span', text='Fund Summary'):
          asset_type = 'Fund'
      elif symbol.find('^') == 0:
          asset_type = 'Index'
      else:
          pass
      return asset_type
docs: Uses BeautifulSoup to scrape symbol category from Yahoo! Finance website