rony2605

Fazer busca site

Mar 14th, 2013
130
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Pega informacao do html no site
  2. import urllib.request
  3.  
  4. page = urllib.request.urlopen("http://beans.itcarlow.ie/prices.html")
  5. text = page.read().decode("utf8")
  6.  
  7. where = text.find('>$') #Busca a partir de $
  8. start_of_prince = where + 2 #casas de inicio
  9. end_of_prince = start_of_prince + 8 #casas fim
  10. prince = text[start_of_prince:end_of_prince]
  11. print(prince)
RAW Paste Data