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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 1453 views
  • 0 likes
  • 2 in conversation