Skip to content
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

Error after executing the script. Don't show script results #10

Closed
Inar-D opened this issue Apr 18, 2020 · 7 comments
Closed

Error after executing the script. Don't show script results #10

Inar-D opened this issue Apr 18, 2020 · 7 comments

Comments

@Inar-D
Copy link

Inar-D commented Apr 18, 2020

image

@luismarcanth
Copy link

same here for AAPL on Market.USA 😢

@windj007
Copy link

windj007 commented Apr 26, 2020

The error says: Automatic downloading is forbidden. I do not know how to overcome it yet.
@ffeast do you know if this API is not working anymore?

Tried to download the same URL from browser, no success... It seems that they may require authentication now.

@windj007
Copy link

windj007 commented May 3, 2020

This API endpoint requires token argument, which is obtained by JavaScript/Ajax. It seems that there is no simple way to get data without browser emulation.

@ffeast
Copy link
Owner

ffeast commented May 8, 2020

Does it still reproduce for you?

% finam-download.py --skiperr=0 --startdate=2001-01-01 --market=USA --contracts=AAPL --destdir=./tmp
INFO:root:Handling AAPL
INFO:finam.export:Fetching https://www.finam.ru/profile/moex-akcii/gazprom/export/
INFO:finam.export:Fetching https://www.finam.ru/cache/N72Hgd54/icharts/icharts.js
DEBUG:finam.export:Parsing line starting with "var aEmitentIds = [4"
DEBUG:finam.export:Parsing line starting with "var aEmitentNames = "
DEBUG:finam.export:Parsing line starting with "var aEmitentCodes = "
DEBUG:finam.export:Parsing line starting with "var aEmitentMarkets "
INFO:__main__:Downloading contract id             20569
name      Apple Inc.
code            AAPL
market            25
Name: 0, dtype: object
INFO:finam.export:Fetching http://export.finam.ru/table.csv?sep=3&at=1&e=.csv&d=d&f=table&dtf=1&MSOR=0&tmf=3&mstimever=1&mstime=on&sep2=1&em=20569&code=AAPL&cn=AAPL&df=1&yf=2001&dt=8&datf=5&yt=2020&market=25&mf=0&mt=4&p=8
INFO:__main__:Sleeping for 1 second(s)
(test1) oleg@MacBook-Air-Oleg trading % head ./tmp/AAPL-DAILY.csv 
index,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>
2001-01-02,7.4375,7.625,7.28125,7.4375,0
2001-01-03,7.25,8.34375,7.21875,8.1875,0
2001-01-04,9.070319999999999,9.25,8.40625,8.53125,0
2001-01-05,8.46875,8.6875,8.03125,8.1875,0
2001-01-08,8.46875,8.492189999999999,7.96875,8.28125,0
2001-01-09,8.40625,8.820319999999999,8.28125,8.59375,0
2001-01-10,8.34375,8.5,8.03125,8.28125,0
2001-01-11,8.125,9.25,8.125,9.0,0
2001-01-12,8.9375,9.0,8.53125,8.59375,0

(test1) oleg@MacBook-Air-Oleg trading % finam-download.py --skiperr=0 --startdate=2001-01-01 --market=COMMODITIES --contracts=BR --destdir=./tmp
INFO:root:Handling BR
INFO:finam.export:Fetching https://www.finam.ru/profile/moex-akcii/gazprom/export/
INFO:finam.export:Fetching https://www.finam.ru/cache/N72Hgd54/icharts/icharts.js
DEBUG:finam.export:Parsing line starting with "var aEmitentIds = [4"
DEBUG:finam.export:Parsing line starting with "var aEmitentNames = "
DEBUG:finam.export:Parsing line starting with "var aEmitentCodes = "
DEBUG:finam.export:Parsing line starting with "var aEmitentMarkets "
INFO:__main__:Downloading contract id        22460
name         BR
code         BR
market       14
Name: 0, dtype: object
INFO:finam.export:Fetching http://export.finam.ru/table.csv?sep=3&at=1&e=.csv&d=d&f=table&dtf=1&MSOR=0&tmf=3&mstimever=1&mstime=on&sep2=1&em=22460&code=BR&cn=BR&df=1&yf=2001&dt=8&datf=5&yt=2020&market=14&mf=0&mt=4&p=8
INFO:__main__:Sleeping for 1 second(s)
(test1) oleg@MacBook-Air-Oleg trading % head ./tmp/BR-DAILY.csv 
index,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>
2009-07-16,63.73,64.32,63.7,64.3,1017
2009-07-17,63.97,66.42,63.96,66.2,1623
2009-07-20,66.66,67.39,66.38,67.39,644
2009-07-21,66.63,68.5,66.63,67.12,242
2009-07-22,67.33,68.01,66.63,67.9,123
2009-07-23,68.05,70.2,67.72,70.2,81
2009-07-24,70.0,70.98,69.77,70.82,230
2009-07-27,71.66,71.83,70.89,70.89,61
2009-07-28,71.46,71.61,69.68,70.35,61

@ffeast
Copy link
Owner

ffeast commented May 10, 2020

Looks like it was a temporary problem / change, I can't reproduce it now (although I managed to reproduce it ~2 weeks ago). Feel free to reopen it if you see this problem again

@IS-live
Copy link

IS-live commented May 10, 2020

Finam removed token authorization, so the script works again.
Thus, when they'll turn token authorization back up, the script will stop working.
Probably current no-token scenario is temporary, not the token usage one.

@AndreyRzhaksinskiy
Copy link

AndreyRzhaksinskiy commented Feb 24, 2021

How we have the same problem:
FinamParsingError: Returned data doesnt seem like a valid csv dataset: Error
Do we have workaround to solve this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants