爬去虚拟币最近交易100条信息
import timeimport requests,json
def run():
times = int(time.time()*1000) #时间戳
instId = str('ETH-USDT') #想查找别的虚拟币只需要把这里改成别的 例如BTC-USDT
url = f'https://www.ouyi.art/priapi/v5/market/trades?t={times}&instId={instId}'
headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36',
'Referer':'https://www.ouyi.art/trade-spot/eth-usdt',
'Host':'www.ouyi.art'
}
response = requests.get(url=url,headers=headers)
html = response.text
for i in json.loads(html)["data"]:
item = {}
item['币种'] = i['instId']
item['数量'] = i['sz']
item['购买时价格'] = i['px'] + 'usdt'
item['订单流水号'] = i['tradeId']
item['购买时间戳'] = i['ts']
print(item)
if __name__ == '__main__':
run() 666 {:10_256:} {:5_95:} 666 {:5_108:} {:5_109:} 都发表情{:5_102:} 好厉害
{:5_106:} 是不是换个网址就不能用这段代码啦 StudyPython_1 发表于 2021-8-26 10:03
是不是换个网址就不能用这段代码啦
网址不同节点基本不同 小白来问,有没有三明治攻击的 666,
页:
[1]