I am working on a project to get information from a web page. in the html source I have the following:
Resultado de Busca: Foram encontrados 264 casais
I need to get the number between "encontrados" and "casais"
is there anyway in Python to do that? what string function should i use? i want o avoid using regular expression in this case.
import urllib.request
f = urllib.request.urlopen("http://listadecasamento.fastshop.com.br/ListaCasamento/ListaCasamentoBusca.aspx?Data=2013-06-07")
s = f.read()
print(s.split())
I got this so far, but now I am having trouble finding the number I need.
import urllib.request
f = urllib.request.urlopen("http://listadecasamento.fastshop.com.br/ListaCasamento/ListaCasamentoBusca.aspx?Data=2013-06-07")
s = f.read()
num = int(s[s.index("encontrados")+len("encontrados"):s.index("casais")])
this give me the error bellow
TypeError: Type str doesn't support the buffer API