Day28 参加职训(机器学习与资料分析工程师培训班),网站设计与网页工程技术

今日练习爬虫,将爬下来的资料传到资料库(今日时间不够,下次上课再进行)

BTC价格

import requests
from bs4 import BeautifulSoup
import json
import datetime

#target_url = 'https://coinmarketcap.com/currencies/bitcoin/historical-data/'
start_time = '1628006400'
end_time = '1628236123'
target_api = 'https://api.coinmarketcap.com/data-api/v3/cryptocurrency/historical?id=1&convertId=2781&timeStart='+ start_time +'&timeEnd='+end_time

#headers = {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'}

data = requests.get( target_api , headers = headers)
json_data = json.loads(data.text)
time = json_data['data']['quotes'][0]['timeOpen']
price = json_data['data']['quotes'][0]['quote']['open']

data_btc = json_data['data']['quotes']
for price in data_btc:
    print (price['timeOpen'])
    print ( price['quote']['open'])

2021-08-04T00:00:00.000Z
38213.33196989
2021-08-05T00:00:00.000Z
39744.51415501


<<:  [ JS个人笔记 ] 闭包Closure—DAY6

>>:  理解React的setState到底是同步还是非同步(上)

Day 15. 来了解Data Persistence in Unity

我的文章系列快要变成每天30分钟,学一点新的东西了。 一样是继续跟着教程走,Implement da...

D3JsDay04一同来见识 D3起手式—用D3写Helloworld

如何开始D3js 方法一 使用CDN 请google搜寻D3Js到D3Js的官方网站。 滑鼠滚轮到下...

计算机概论 - 网路通讯与网际网路 Networking and the internet (下)

在不同电脑之间因为有分享资源和资讯的需求而产生彼此连结的电脑系统称之为网路 (networks),网...

排线相机 (续)

上次我们最後提到一些例子 -sh sharpness -100~100 -br brightness...

[Day11] 2D的数学世界 (三) - 位移、旋转、缩放

今日目标 位移、旋转、缩放 以下位移、旋转、缩放仅是补充,又或着是说个人笔记(?),阅读这篇单纯的看...