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!
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/
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.
Ready to level-up your skills? Choose your own adventure.