Closed rsheftel closed 1 year ago
@rsheftel
Thank you for bringing this up. I have been trying to find a way to do this with urlopen for awhile now. The requests are rejected for some reason. If you could find a way to get it working and open a merge request it would help a ton. I am really busy right now on other projects. I probably wouldn't be able to look at this until the beginning of next year.
I will take a look, I am not well versed in these packages so not sure I will succeed.
I will take a look, I am not well versed in these packages so not sure I will succeed.
Thanks!
edit:
Just wanted to add that this maybe a good place for you to start looking:
Was a solution ever found for this?
I fixed the init file: Have to add this at the top: from urllib.request import urlopen In the code, change to this: response = urlopen(url) and response = urlopen(api_url)
@alecjonas When I do that for Python 3.8, I receive the following warnings:
/usr/local/lib/python3.8/site-packages/yahoofinancials/init.py:153 /usr/local/lib/python3.8/site-packages/yahoofinancials/init.py:153: DeprecationWarning: invalid escape sequence \s self._cache[url] = loads(re.search("root.App.main\s+=\s+({.*})", script).group(1))
/usr/local/lib/python3.8/site-packages/html5lib/_trie/_base.py:3 /usr/local/lib/python3.8/site-packages/html5lib/_trie/_base.py:3: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working from collections import Mapping
@JECSand A friendly FYI
It otherwise works.
I came across this repo/issue while troubleshooting the same warning on my app. I nixed the warning by switching from urllib to requests altogether. It was a really painless transition.
@JECSand Are you open to the idea of switching the library?
@Wittionary I'm not against the idea, the initial goal was to try keeping 3rd party requirements to a minimum.
I get the following warning when using this package:
DeprecationWarning: UrlOpener style of invoking requests is deprecated. Use newer urlopen functions/methods