Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Старожил


Сообщения: 239
Благодарности: 8

Профиль | Отправить PM | Цитировать


Sham, по совету из сообщения №6 у меня не получилось получить Cookie.
по ссылке есть код. еще и не известно рабочий или нет, но как этот код проверить? возможно ли переделать под Excel или VBS или под SHell или VGet?
Скрытый текст
/* use WORK location to store our temp files */
filename out "%sysfunc(getoption(WORK))/output.txt";
filename hdrout "%sysfunc(getoption(WORK))/response1.txt";

/* This PROC step caches the cookie for the website finance.yahoo.com */
/* and captures the web page for parsing later */
proc http
out=out
headerout=hdrout
url="https://finance.yahoo.com/quote/AAPL/history?p=AAPL"
method="get";
run;

/* Read the response and capture the cookie value from */
/* the CrumbStore field. */
/* The file has very long lines, longer than SAS can */
/* store in a single variable. So we read in <32k chunks. */
data crumb (keep=crumb);
infile out recfm=n lrecl=32767;
/* the @@ directive says DON'T advance pointer to next line */
input txt: $32767. @@;
pos = find(txt,"CrumbStore");
if (pos>0) then
do;
crumb = dequote(scan(substr(txt,pos),3,':{}'));
/* cookie value can have unicode characters, so must URLENCODE */
call symputx('getCrumb',urlencode(trim(crumb)));
output;
end;
run;

%put &=getCrumb.;

filename data "%sysfunc(getoption(WORK))/data.csv";
filename hdrout2 "%sysfunc(getoption(WORK))/response2.txt";

proc http
out=data
headerout=hdrout2
url="https://query1.finance.yahoo.com/v7/finance/download/AAPL?period1=1535835578%str(&)period2=1538427578%str(&)interval=1d%str(&)events=history%str(&)crumb= &getCrumb."
method="get";
run;

proc import
file=data
out=history
dbms=csv
replace;
run;

proc sgplot data=history;
highlow x=date high=high low=low / open=open close=close;
xaxis display=(nolabel) minor;
yaxis display=(nolabel);
run;

Отправлено: 16:03, 30-06-2019 | #11