私はこのウェブサイトでbtcの価格を取得したいと思います。美味しいスープはウェブサイトでより深く解析します
from bs4 import BeautifulSoup
url = "https://koinim.com"
r = requests.get(url)
soup = BeautifulSoup(r.content, 'html.parser')
g_data = soup.find_all(attrs={"nav-BTC-price"})
print(g_data)
結果は次のとおりです。
[<strong class="nav-BTC-price">10002.99</strong>]
Process finished with exit code 0
私はちょうどたいが、BTC価格(10002.99)を取ります。
TY
'度G_data [0] .text' - >' '10002.99'' –