<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Infinite scroll via proc http in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Infinite-scroll-via-proc-http/m-p/732913#M80388</link>
    <description>&lt;P&gt;Hello Kawakami,&lt;/P&gt;
&lt;P&gt;Kindly excuse my style, as I am not professionally trained to write SAS programs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let site="&lt;A href="https://www.investing.com/crypto/currencies" target="_blank"&gt;https://www.investing.com/crypto/currencies&lt;/A&gt;";&lt;BR /&gt;filename source temp;&lt;BR /&gt;&lt;BR /&gt;PROC HTTP&lt;BR /&gt;URL = &amp;amp;site&lt;BR /&gt;OUT = source&lt;BR /&gt;METHOD = "GET";&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA Temp(DROP = line); &lt;BR /&gt;INFILE source LENGTH = recLen LRECL = 32767;&lt;BR /&gt;INPUT line $VARYING32767. recLen;&lt;BR /&gt;do until (_Top);&lt;BR /&gt;_Top=find(_infile_,'&amp;lt;table class="genTbl openTbl');&lt;BR /&gt;if not _Top then input;&lt;BR /&gt;end;&lt;BR /&gt;do until (_Bottom);&lt;BR /&gt;input;&lt;BR /&gt;_Bottom=find(_infile_,'&amp;lt;/table&amp;gt;');&lt;BR /&gt;if _Bottom then STOP;&lt;BR /&gt;else do; &lt;BR /&gt;Record=_infile_;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;Drop _:;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;Data Temp2;&lt;BR /&gt;rx1=prxparse("s/&amp;lt;.*?&amp;gt;//");&lt;BR /&gt;set temp (firstObs=16);&lt;BR /&gt;length result FinalResult $ 2000;&lt;BR /&gt;Retain result;&lt;BR /&gt;if mod(_n_, 12) ne 0 then result=cats(result, "|", record);&lt;BR /&gt;else do;&lt;BR /&gt;finalResult=result;&lt;BR /&gt;call prxchange(rx1,-1,FinalResult);&lt;BR /&gt;result ="";&lt;BR /&gt;end;&lt;BR /&gt;If FinalResult="" then delete;&lt;BR /&gt;Keep FinalResult;&lt;BR /&gt;/*I will use scan() to extract each variable from FinalResult*/&lt;/P&gt;
&lt;P&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 11 Apr 2021 22:58:17 GMT</pubDate>
    <dc:creator>JAR</dc:creator>
    <dc:date>2021-04-11T22:58:17Z</dc:date>
    <item>
      <title>Infinite scroll via proc http</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Infinite-scroll-via-proc-http/m-p/732813#M80386</link>
      <description>&lt;P&gt;I am trying to get data (nearly 4000 rows) from a page, which has an infinite scroll. Proc HTTP reads only the first 100 rows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could someone please help me to solve this!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;JAR&lt;/P&gt;</description>
      <pubDate>Sun, 11 Apr 2021 03:44:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Infinite-scroll-via-proc-http/m-p/732813#M80386</guid>
      <dc:creator>JAR</dc:creator>
      <dc:date>2021-04-11T03:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Infinite scroll via proc http</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Infinite-scroll-via-proc-http/m-p/732910#M80387</link>
      <description>&lt;P&gt;Can you provide the code including the url?&lt;/P&gt;</description>
      <pubDate>Sun, 11 Apr 2021 22:06:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Infinite-scroll-via-proc-http/m-p/732910#M80387</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-04-11T22:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Infinite scroll via proc http</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Infinite-scroll-via-proc-http/m-p/732913#M80388</link>
      <description>&lt;P&gt;Hello Kawakami,&lt;/P&gt;
&lt;P&gt;Kindly excuse my style, as I am not professionally trained to write SAS programs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let site="&lt;A href="https://www.investing.com/crypto/currencies" target="_blank"&gt;https://www.investing.com/crypto/currencies&lt;/A&gt;";&lt;BR /&gt;filename source temp;&lt;BR /&gt;&lt;BR /&gt;PROC HTTP&lt;BR /&gt;URL = &amp;amp;site&lt;BR /&gt;OUT = source&lt;BR /&gt;METHOD = "GET";&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA Temp(DROP = line); &lt;BR /&gt;INFILE source LENGTH = recLen LRECL = 32767;&lt;BR /&gt;INPUT line $VARYING32767. recLen;&lt;BR /&gt;do until (_Top);&lt;BR /&gt;_Top=find(_infile_,'&amp;lt;table class="genTbl openTbl');&lt;BR /&gt;if not _Top then input;&lt;BR /&gt;end;&lt;BR /&gt;do until (_Bottom);&lt;BR /&gt;input;&lt;BR /&gt;_Bottom=find(_infile_,'&amp;lt;/table&amp;gt;');&lt;BR /&gt;if _Bottom then STOP;&lt;BR /&gt;else do; &lt;BR /&gt;Record=_infile_;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;Drop _:;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;Data Temp2;&lt;BR /&gt;rx1=prxparse("s/&amp;lt;.*?&amp;gt;//");&lt;BR /&gt;set temp (firstObs=16);&lt;BR /&gt;length result FinalResult $ 2000;&lt;BR /&gt;Retain result;&lt;BR /&gt;if mod(_n_, 12) ne 0 then result=cats(result, "|", record);&lt;BR /&gt;else do;&lt;BR /&gt;finalResult=result;&lt;BR /&gt;call prxchange(rx1,-1,FinalResult);&lt;BR /&gt;result ="";&lt;BR /&gt;end;&lt;BR /&gt;If FinalResult="" then delete;&lt;BR /&gt;Keep FinalResult;&lt;BR /&gt;/*I will use scan() to extract each variable from FinalResult*/&lt;/P&gt;
&lt;P&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Apr 2021 22:58:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Infinite-scroll-via-proc-http/m-p/732913#M80388</guid>
      <dc:creator>JAR</dc:creator>
      <dc:date>2021-04-11T22:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Infinite scroll via proc http</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Infinite-scroll-via-proc-http/m-p/732924#M80389</link>
      <description>&lt;P&gt;The data embedded in the html source seems to only have the 1st to 100th place to begin with.&lt;BR /&gt;I think the javascript (window.siteData.defaultDomainCurrData part) is probably updating the data in real time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think proc http can handle javascript.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found this paper, but I'm not sure if it's helpful.&lt;BR /&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3169-2019.pdf" target="_self"&gt;https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3169-2019.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 00:23:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Infinite-scroll-via-proc-http/m-p/732924#M80389</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-04-12T00:23:06Z</dc:date>
    </item>
  </channel>
</rss>

