We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6496cf commit 9054500Copy full SHA for 9054500
WebScrapingScripts/Real-Time Bitcoin Rate/bitcoin_rate.py
@@ -0,0 +1,12 @@
1
+# BeautifulSoup is a python library for pulling data out of HTML and XML files
2
+from bs4 import BeautifulSoup as BS
3
+# requests module allows you to send HTTP requests and returns a Response Object with all the response.
4
+import requests
5
+def get_price(url):
6
+ data=requests.get(url) # Accessing all required data from url site and store in data.
7
+ soup=BS(data.text,"html.parser") # It takes text of page as argument and then parse it with html.parser
8
+ ans=soup.find("div",class_="BNeawe iBp4i AP7Wnd").text # here the class name is passed as argument to find out that particular info in html text
9
+ return ans
10
+url="https://www.google.com/search?q=bitcoin+price"
11
+ans=get_price(url)
12
+print("1 Bitcoin = ",ans)
0 commit comments