-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP Error 403: Forbidden #33
Comments
Yes it seems so. Would be happy to see a pull request because I don't have spare time to figure it out |
I tryed to replace user-agent but error stil repduces. So problen is in securuty policy of finam api. |
yes, i did the same and got same result... it seems that security protection distinguishes somehow differently (not by user-agent). i stopped attemts to figure it out and starting to find another way to get stocks quotes |
Workaround with selenium ` ... exporter = Exporter(fetcher = fetcher) ` |
Interesting. Pull request? |
No nesessary, just copy and use. Also this way contains issue with encoding for cyrilyc symbols. update def fetcher (url, lines=False): UPD 28.01.23: Working solution |
Добрый день, |
Complete workaround, contains downloading data. def fetcher (url, lines=False): def fetcher_download(url, readlines = False): exporter = Exporter(fetcher = fetcher) I think this solution is temorary, until Finam changes an autorisation of the web downloading page. |
Thanks @ffeast fo the extensible and clear code. |
|
Hi |
Hello @ffeast ! Thank you for a quick response. I don't see any comment to the PR at the moment. I am not sure why. On one hand, I agree with you that it is not the best decision to have two independant fetchers in Exporter class. By the other hand, it gives a user an option to declare using standart urllib fetcher manually in the case if token-protection will be disabled one day. What do you think? Or maybe you can even suggest more effective solution? |
Hello @ffeast! Unfortunately, not. And it is quite strange. Look at the screenshot 1 and screenshot 2. |
@ffeast Hello again! So, since I don't see any comment on the PR page maybe you can post it here? |
issue came approximately last month, when i tried to run a script, that work appropriate for 1 year at least.
error came:
Traceback (most recent call last):
File "C:_python_projects\my_finance\stock_quotes.py", line 24, in finam_quote
paper = exporter.lookup(code=ticker, market=market)
File "C:_python_python3.9\lib\site-packages\finam\export.py", line 303, in lookup
return self._meta.lookup(*args, **kwargs)
File "C:_python_python3.9\lib\site-packages\finam\export.py", line 220, in lookup
self._load()
File "C:_python_python3.9\lib\site-packages\finam\export.py", line 167, in _load
meta_url = page.find_meta_file()
File "C:_python_python3.9\lib\site-packages\finam\export.py", line 82, in find_meta_file
html = self._fetcher(self.FINAM_ENTRY_URL)
File "C:_python_python3.9\lib\site-packages\finam\export.py", line 55, in fetch_url
raise FinamDownloadError('Unable to load {}: {}'.format(url, e))
finam.exception.FinamDownloadError: Unable to load https://www.finam.ru/profile/moex-akcii/gazprom/export/: HTTP Error 403: Forbidden
It seems like finam restrict automatic loading, because i can do it from same computer, using web interface
The text was updated successfully, but these errors were encountered: