We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06ca991 commit 2c1c333Copy full SHA for 2c1c333
Python/bitcoin-price/README.md
Python/bitcoin-price/current_price.py
@@ -0,0 +1,14 @@
1
+import requests
2
+from bs4 import BeautifulSoup as BS
3
+
4
+# We are basically getting the URL of coinmarket camp and scraping it's content
5
+soup = BS(requests.get('https://coinmarketcap.com/currencies/bitcoin/').content, features="lxml")
6
7
+# Here we are searching for the corresponding div in which span class is present
8
+# then we need to extract the span class
9
+div = soup.find("div", {"class" : "f6l7tu-0 cdygDb cmc-details-panel-price"
10
+}).find("span", {"class" : "cmc-details-panel-price__price"})
11
12
+# Now we print all elements extracted from div
13
+for i in div:
14
+ print(i)
0 commit comments