獲取 bitcoin 實時價格

code

[root@localhost ~]# cat test.py 
import sys,os
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys

option = webdriver.ChromeOptions()
option.add_argument('--no-sandbox')
option.add_argument('--headless')
driver = webdriver.Chrome(options=option)

driver.get("https://www.coincola.info/trading/btc/usdt")

while(True):
    driver.implicitly_wait(3.5)
    time.sleep(2) 
    price=driver.find_element_by_class_name("d6VoI").text
    print(price)

print(driver.title)
driver.quit()
[root@localhost ~]# 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章