The code breaks when the value returned is an integer, I mean, if it has no comma:
$ python sample.py
Inflação Meta: 4,5
Inflação acumulada 12 últimos meses: 2,8
Poupança: 0,3994
Dólar compra: 3,3048
Dólar venda: 3,3054
Traceback (most recent call last):
File "sample.py", line 18, in <module>
print(u'Selic meta: %s' % selic.get_selic_meta())
File "/home/israelst/projects/bancocentralbrasil/bancocentral.py", line 96, in get_selic_meta
selic_meta = re.search('<div id=label>Meta:</div><div id=rate><div id=ratevalue>(\d+,\d+)</div>', selic).group(1)
AttributeError: 'NoneType' object has no attribute 'group'