yfinance icon indicating copy to clipboard operation
yfinance copied to clipboard

May be two problem about using proxy

Open rwayan opened this issue 10 months ago • 3 comments

Describe bug

def _lazy_load_price_history(self):
    if self._price_history is None:
        self._price_history = PriceHistory(self._data, self.ticker, self._get_ticker_tz(self.proxy, timeout=10),
  •             proxy=self.proxy # orignal code here not setting proxy
    

) return self._price_history

def get_income_stmt(self, proxy=None, as_dict=False, pretty=False, freq="yearly"):
    """
    :Parameters:
        as_dict: bool
            Return table as Python dict
            Default is False
        pretty: bool
            Format row names nicely for readability
            Default is False
        freq: str
            "yearly" or "quarterly"
            Default is "yearly"
        proxy: str
            Optional. Proxy server URL scheme
            Default is None
    """
    self._fundamentals.proxy = proxy or self.proxy

    data = self._fundamentals.financials.get_income_time_series(freq=freq, 
    +proxy=self._fundamentals.proxy)   #orignal code not set proxy here

maybe some other place have same problem, please help

Simple code that reproduces your problem

setting proxy at ticker ,

Debug log from yf.enable_debug_mode()

please check proxy setting in all calling

Bad data proof

No response

yfinance version

0.2.54

Python version

3.11

Operating system

windows

rwayan avatar Mar 02 '25 05:03 rwayan

Does PR #2216 solve?

ValueRaider avatar Mar 02 '25 11:03 ValueRaider

Does PR #2216 solve?

thx a lot

rwayan avatar Mar 10 '25 02:03 rwayan

Update: #2391 will handle this

ValueRaider avatar Mar 30 '25 20:03 ValueRaider