Advertisement
webbersof

Bitcoin actual price

Feb 8th, 2022
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup as bs
  3.  
  4. URL = 'https://coinmarketcap.com/currencies/bitcoin/'
  5. req = requests.get(URL)
  6.  
  7. soup = bs(req.content, 'html.parser')
  8.  
  9. price = soup.find('div', {'class': 'priceValue'})
  10. extract = price.select_one('span')
  11.  
  12. print(f'Bitcoin price today is {extract.text} per (BTC / USD)')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement