Member-only story

Extract Bitcoin Price In Realtime

Shweta Lodha
2 min readFeb 9, 2022

--

This article talks about how we can read web pages and extract current Bitcoin prices. Now, to perform this web scrapping, we need few things:

  • Website
  • Web scrapping libraries/tools
  • Programming language

Website

This is the website from which we are going to read the price of Bitcoin. There are many websites, from which you can read this data but for this article, I’m using Coinmarketcap.com and its URL is

https://coinmarketcap.com/currencies/bitcoin

Web Scraping Libraries/Tools

There are many web scraping libraries and tools available in the market. Below is the list of my recommendations:

  • Beautiful Soup
  • Scrapy
  • Requests (HTTP for humans)
  • LXML
  • Selenium

If you want to know the brief of any of these, you can watch out my video on YouTube. For this article, I’m using Requests along with Beautiful Soup.

Programing Language

This article uses Python as a programming language

import requests
from bs4 import BeautifulSoup as bs
URL = "https://coinmarketcap.com/currencies/bitcoin/"
reponse = requests.get(URL)
htmlContent = bs(reponse.content,'html.parser')
divTagContent = htmlContent.find('div',{'class':'priceValue'})

--

--

Shweta Lodha
Shweta Lodha

No responses yet