import threading
import time
from bs4 import BeautifulSoup
def scrap():
response = urllib2.urlopen('http://www.vietcombank.com.vn/exchangerates/')
html = response.read()
soup = BeautifulSoup(html)
for i in soup.findAll('td',{"class":"code"}):
if i.contents[0] == 'USD':
print "Sell "+ i.find_all_next()[1].text
print "Buy "+ i.find_all_next()[3].text
#t = threading.Timer(5, scrap)
while True:
scrap()
time.sleep(30)
Không có nhận xét nào:
Đăng nhận xét