<?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: How to download an excel file from a password protected website in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621074#M182537</link>
    <description>Something like this maybe. Only I have to do one more step before by entering a user and pass? &lt;A href="https://blogs.sas.com/content/sgf/2018/11/01/proc-http-download-data/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2018/11/01/proc-http-download-data/&lt;/A&gt;</description>
    <pubDate>Thu, 30 Jan 2020 07:45:58 GMT</pubDate>
    <dc:creator>sas_student1</dc:creator>
    <dc:date>2020-01-30T07:45:58Z</dc:date>
    <item>
      <title>How to download an excel file from a password protected website</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621044#M182521</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have question on how to download an excel file from a password protected website using SAS. Unfortunately, I cant share the website as its password protected and confidential, but am hoping with enough detail someone can start to guide me in the right direction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe this website does not have API. If I was to manually download a file, I would first have to go to a main page and type in my username and password. once in I would be at a page with multiple headers. When I click on the header a drop down comes up and I would have to click on an option "output reports" that would open another page with multiple links such as "hospital reports" or "Housing reports" , I would then click on one of those and a pop window like the pic below would come up asking "what do you want to do with [filename].xls?" I would click on save as to save the file in my directory.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if one was to look at the URL line I would be click through 3 URLs to get to the page I need to download the excel file from.&lt;/P&gt;&lt;P&gt;The transfer protocol of the URL is https, the hostname of the 3 URLs is the same, but I need to go through 3 locations of the webpage and on the third location is from where I would download the file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I do this in SAS? are there any article or sample codes that I can use and build on? Do I have to deal with cookies? If so, how?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more thing to note, and I have to confirm this but, I believe that the .xls file name under the "what do you want to do with" message (the black censored) is not always the same file name (which maybe annoying)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Suggestions to try would be very much appreciated. I am using SAS 9.4 TS Level 1M1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saspic.png" style="width: 421px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35742iF45AB315443B549C/image-size/large?v=v2&amp;amp;px=999" role="button" title="saspic.png" alt="saspic.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 03:49:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621044#M182521</guid>
      <dc:creator>sas_student1</dc:creator>
      <dc:date>2020-01-30T03:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to download an excel file from a password protected website</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621058#M182526</link>
      <description>&lt;P&gt;Why not just download the Excel file manually to your PC then use SAS to read it from there? It's a whole lot easier than trying to automate a download when there is no API. &lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 06:07:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621058#M182526</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-01-30T06:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to download an excel file from a password protected website</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621060#M182527</link>
      <description>Because after downloading the file I would like to create different reports. And the data is updated monthly and eventually would Iike to automate the process.</description>
      <pubDate>Thu, 30 Jan 2020 06:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621060#M182527</guid>
      <dc:creator>sas_student1</dc:creator>
      <dc:date>2020-01-30T06:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to download an excel file from a password protected website</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621061#M182528</link>
      <description>&lt;P&gt;Automation needs a stable, defined interface. From your description it is quite clear that such is not present, so you're better off doing it manually. Trying to automate that would only mean that you need to rewrite the code every time you download, and that will cause more work than doing the download yourself in the first place.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 06:34:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621061#M182528</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-30T06:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to download an excel file from a password protected website</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621066#M182532</link>
      <description>Not to be a pain but can you please explain why the interface is not stable and defined? The website link will not change, the excel table structure won’t change. Not understanding the unstability. Also just for my knowledge and getting more experience in SAS regardless of automation or why is there a way that one can do this, even if it’s complicated? I’m sure before API SAS has the capability right? Are there articles that one can point me to learn and gain knowledge?</description>
      <pubDate>Thu, 30 Jan 2020 07:10:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621066#M182532</guid>
      <dc:creator>sas_student1</dc:creator>
      <dc:date>2020-01-30T07:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to download an excel file from a password protected website</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621068#M182534</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/103523"&gt;@sas_student1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Not to be a pain but can you please explain why the interface is not stable and defined? The website link will not change, the excel table structure won’t change. Not understanding the unstability. Also just for my knowledge and getting more experience in SAS regardless of automation or why is there a way that one can do this, even if it’s complicated? I’m sure before API SAS has the capability right? Are there articles that one can point me to learn and gain knowledge?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Quote:&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;One more thing to note, and I have to confirm this but, I believe that the .xls file name under the "what do you want to do with" message (the black censored) is not always the same file name (which maybe annoying)"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So the file name changes, and it seems in unpredictable ways. This defines instability in my world.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you can define the URL for a given file automatically, then filename url allows to specify a user and password for authentication, so you should be able to define that http access in code. See if the final URL of the file you download has a predictable structure that can be built from parameters like dates.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But if you first have to go through a login page to create a session dynamically, and then use the session key to get another page where you need to scan through the page for some text to find the next page, and then scan through that page to somehow determine today's filename, ....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You get what I am aiming at?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 07:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621068#M182534</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-30T07:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to download an excel file from a password protected website</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621070#M182536</link>
      <description>Ah okay I see what you are saying.&lt;BR /&gt;So I will check to see if the file name changes or not. But if it doesn’t change then there is a url that gets to the page where one has to click on the “hospital report” link that opens the “where do you want to save dialogue”. So manually I have to click multiple times to get to the url that has the download file. In that case I should be able to code that url and add a user and pass to the code to get the file to download right?</description>
      <pubDate>Thu, 30 Jan 2020 07:37:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621070#M182536</guid>
      <dc:creator>sas_student1</dc:creator>
      <dc:date>2020-01-30T07:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to download an excel file from a password protected website</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621074#M182537</link>
      <description>Something like this maybe. Only I have to do one more step before by entering a user and pass? &lt;A href="https://blogs.sas.com/content/sgf/2018/11/01/proc-http-download-data/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2018/11/01/proc-http-download-data/&lt;/A&gt;</description>
      <pubDate>Thu, 30 Jan 2020 07:45:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621074#M182537</guid>
      <dc:creator>sas_student1</dc:creator>
      <dc:date>2020-01-30T07:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to download an excel file from a password protected website</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621084#M182539</link>
      <description>&lt;P&gt;You can specify user and password for a URL file reference, and use that first in proc http to retrieve cookies or other session validation items.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 08:56:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-download-an-excel-file-from-a-password-protected-website/m-p/621084#M182539</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-30T08:56:44Z</dc:date>
    </item>
  </channel>
</rss>

