Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup as bs
- URL = 'https://coinmarketcap.com/currencies/bitcoin/'
- req = requests.get(URL)
- soup = bs(req.content, 'html.parser')
- price = soup.find('div', {'class': 'priceValue'})
- extract = price.select_one('span')
- print(f'Bitcoin price today is {extract.text} per (BTC / USD)')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement