#-*-coding:utf-8 -*-
importurllibimportreimportjsonimporturllib2from lxml importetreeimportrequestsimporttimefrom Queue importQueueimportmatplotlib.pyplot as plt
URL= 'http://quote.fx678.com/exchange/WH'nation_que=Queue()
nation=Queue()
high=Queue()
start_time=Queue()
Chart=[]def __cmp__(self, other):if self.time
elif self.time ==other.time:return0else:return 1
classShare:def __init__(self,time,score):
self.time=time
self.score=scoredef __getitem__(self, key):
self.item.get(key)def __cmp__(self, other):returncmp(self.time, other.time)def __str__(self):return self.time + " " +str(self.score)def download(url, headers, num_try=2):while num_try >0:
num_try-= 1
try:
content= requests.get(url, headers=headers)returncontent.textexcepturllib2.URLError as