yfinance
yfinance copied to clipboard
Setting custom User Agent for multiple ticker downloads
I'm trying to set as custom user agent header for fetching multiple tickers.
Does anyone know if this is available or will be available in the near future?
Regards,
Not supported by the looks of it.
https://github.com/ranaroussi/yfinance/blob/main/yfinance/multi.py#L179
Just need to pass the session object down there so shouldn't be too hard to implement this.
Seems it is supported by modifying requests
object, library methods have parameter named session
which takes requests
object. Sample code is on ReadMe file or here
This could be implemented easily with e.g. yf.set_custom_header(...)
, storing internally in a global variable for use later. Or maybe there is a better way
If someone implements and submits a good PR, I can merge.