Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
data fetching for indian stock
#1
Hi,
Can you help me with a python code to get following data in excel sheet.
The input excel file has name of tickers of Indian stocks, file name stocks.xlsx
Following data required in output excel file name stocks_output.xlsx
both files are attached

Attached Files

.xlsx   stocks.xlsx (Size: 8.73 KB / Downloads: 38)
.xlsx   stocks_output.xlsx (Size: 5.15 KB / Downloads: 36)
Reply
#2
Where do you want to get data from?

Maybe you want to webscrape some Indian stocks and shares webpage?

If that is the case, provide a link and post the question in the forum "webscraping" perhaps? Doesn't sound too difficult for experienced "scrapers"!
Reply
#3
(Nov-23-2025, 12:27 AM)Pedroski55 Wrote: Where do you want to get data from?

Maybe you want to webscrape some Indian stocks and shares webpage?

If that is the case, provide a link and post the question in the forum "webscraping" perhaps? Doesn't sound too difficult for experienced "scrapers"!

to get Data from Yahoo finance
Reply
#4
Hi,

so what's the specific problem? Which code do you have? Please show here. Or is you expectation that somebody writes you code custom-tailored for your requirements for free?

Regards, noisefloor
Reply
#5
(Nov-23-2025, 07:50 AM)noisefloor Wrote: Hi,

so what's the specific problem? Which code do you have? Please show here. Or is you expectation that somebody writes you code custom-tailored for your requirements for free?

Regards, noisefloor

I am very new for codes.
I have no idea how to write a code.
So if you can write one it will be a very great of you
Thanks
Reply
#6
(Nov-23-2025, 11:43 AM)drakhsin Wrote: I am very new for codes.
I have no idea how to write a code.
Here a start,these tools are not hard to use,but you should learn some Python basic stuff to.
These day all LLM that are online are is capable to give same answer,so Forum like this don't get much traffic these days.
import yfinance as yf
import pandas as pd

# Choose a ticker
ticker = "ITC.NS"

# Get data for the last year (interval = 1 day)
data = yf.download(ticker, period="1y", interval="1d", auto_adjust=False)
print(data.head())
# To Excel
data.to_excel("itc.xlsx")
Pedroski55 likes this post
Reply
#7
Well, that's disappointing, I thought I would make a million dollars quickly, but all I get is an error:

import yfinance as yf
import pandas as pd

ticker = "ITC.NS"
data = yf.download(ticker, period="1wk", interval="1d", auto_adjust=False)
data is an empty dataframe!


Output:
[*********************100%***********************] 1 of 1 completed 1 Failed download: ['ITC.NS']: YFRateLimitError('Too Many Requests. Rate limited. Try after a while.')
How might I get around this error??

Trying after a while did not help.

EDIT: Think I know why:

Quote:As of November 1st, 2021 Yahoo’s suite of services will no longer be accessible from mainland China. Yahoo products and services remain unaffected in all other global locations. We thank you for your support and readership.

Even with VPN on I can't access yahoo finance! There goes my million dollars Angry Angry Angry
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Fetching Images from DB in Django Dexty 2 3,288 Mar-15-2024, 08:43 AM
Last Post: firn100
  fetching, parsing data from Wikipedia apollo 2 5,065 May-06-2021, 08:08 PM
Last Post: snippsat
  Fetching and Parsing XML Data FalseFact 3 5,716 Apr-01-2019, 10:21 AM
Last Post: Larz60+
  how to make my product description fetching function generic? PrateekG 10 9,634 Jun-29-2018, 01:03 PM
Last Post: PrateekG
  Getting 'list index out of range' while fetching product details using BeautifulSoup? PrateekG 8 11,484 Jun-06-2018, 12:15 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020