Advertisement
rony2605

Le o conteudo da pagina do fornecedor

Mar 16th, 2013
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. import urllib.request
  2.  
  3. def get_prince():
  4.     page = urllib.request.urlopen("http://beans.itcarlow.ie/prices.html")
  5.     text = page.read().decode("utf8")
  6.     where = text.find('>$')
  7.     start_of_price = where + 2
  8.     end_of_price = start_of_price + 4
  9.     print(text[start_of_price:end_of_price])
  10. get_prince()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement