em đang đọc sách về python 3 thì có đoạn code về viêc lấy dữ liệu cụ thể là giá cà phê của một trang web
chỗ em thắc mắc là trong vòng lặp có cái gì đó sai sai . em thấy rằng việc thiết lập lại giá trị text , page sẽ luôn để vị trí tìm kiếm ở đầu nó sẽ chỉ tìm ở vị trí đầu tiên
import urllib.request
price = 99.99
while price > 4.74:
page = urllib.request.urlopen("http://")
text = page.read().decode("utf8")
where = text.find('>$')
start_of_price = where + 2
end_of_price = start_of_price + 4
price = float(text[start_of_price:end_of_price])
print ("Buy")