Skip to content

Commit d229a71

Browse files
Merge pull request prathimacode-hub#425 from neelshah2409/main
Gold Price Fetcher
2 parents 43dd631 + 28536a1 commit d229a71

File tree

7 files changed

+38
-0
lines changed

7 files changed

+38
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Loading
Loading
Loading
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Gold Price Fetcher
2+
3+
## Short description of package/script
4+
WE can fetch the price of gold using request and bs4 library from the website and getting the proper format and getting the proper result.We also get the difference of today's price and yesterday's
5+
price of gold ,so we can have a better idea for buying the gold.
6+
7+
## List out the libraries imported
8+
-> requests
9+
->bs4
10+
11+
## Setup instructions
12+
For using this script we just need to run this sciprt and for making your own script we just need the website url of gold prices.
13+
14+
## Output
15+
![Image](Images/output(gold).png)
16+
![Image](Images/website(gold).png)
17+
18+
## Author:
19+
NEEL SHAH
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import requests
2+
from bs4 import BeautifulSoup
3+
4+
#Getting the url
5+
page = requests.get("https://www.goodreturns.in/gold-rates/")
6+
Soup = BeautifulSoup(page.content,'html.parser')
7+
8+
#finding the proper data
9+
info = Soup.find_all(class_="odd_row")
10+
count = 0
11+
12+
#proper fomatting of data
13+
for items in info:
14+
count +=1
15+
if count ==2:
16+
print(items.get_text())
17+
break
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Libraries used: requests ,bs4

0 commit comments

Comments
 (0)