BookmarkSubscribeRSS Feed
ilearnsas
Obsidian | Level 7

Hi

I am working on a proc http download.

 

However this webpage has a login and password.

 

Also, the steps are not direct. After I login, I change the date parameter to the current month and year and then click download to download the csv file. 

 

Earlier, I was succesful with the proc http direct download without a login. However, with a login and navigation to a few different places on the website, I am unsure how to proceed. Could someone please guide me? 

 

Step 1- I wrote the code proc http to be able to connect via a proxy and download a file. 

 

%let proxy_host = proxy.companyname.com; /*Replaced with company name*/ 
%let port = 1234;  /*For Example only*/ 

 

filename response '/home/Test_Datasets/Media/Login_response.html';
filename out '/home/Test_Datasets/Media/Login_Header.txt';


/*Log in to this website */
proc http
method="POST"
url="https://portal.mintel.com/external/requestLogin?"
ct="application/x-www-form-urlencoded"
proxyhost="&proxy_host."
proxyport=1234

in='csrfmiddlewaretoken=b4olxF2UFL2GyjtwQ2wGJrraSDDJKVZZZGaRRqBoJ7wu0waE1bVHTb3fK3LuoLNx&login_view-current_step=auth&auth-next=&auth-password=******&auth-username=****%gmail.com'
headerout= out
out=response;
run;

 

Not sure what my step 2 should be? 

 

Thanks! 

1 REPLY 1
SuryaKiran
Meteorite | Level 14

Hello,

 

Did you try the WEBUSERNAME= & WEBPASSWORD= options for PROC HTP. Check these documents:

https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3232-2019.pdf

https://blogs.sas.com/content/sgf/2018/11/01/proc-http-download-data/

Thanks,
Suryakiran

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1273 views
  • 0 likes
  • 2 in conversation