Hello Kawakami,
Kindly excuse my style, as I am not professionally trained to write SAS programs:
%let site="https://www.investing.com/crypto/currencies"; filename source temp; PROC HTTP URL = &site OUT = source METHOD = "GET"; RUN;
DATA Temp(DROP = line); INFILE source LENGTH = recLen LRECL = 32767; INPUT line $VARYING32767. recLen; do until (_Top); _Top=find(_infile_,'<table class="genTbl openTbl'); if not _Top then input; end; do until (_Bottom); input; _Bottom=find(_infile_,'</table>'); if _Bottom then STOP; else do; Record=_infile_; output; end; end; Drop _:; Run; Data Temp2; rx1=prxparse("s/<.*?>//"); set temp (firstObs=16); length result FinalResult $ 2000; Retain result; if mod(_n_, 12) ne 0 then result=cats(result, "|", record); else do; finalResult=result; call prxchange(rx1,-1,FinalResult); result =""; end; If FinalResult="" then delete; Keep FinalResult; /*I will use scan() to extract each variable from FinalResult*/
run;
... View more