Forum Discussion
Get html code of an BIG-IP page through curl/code
Hello Folks
Greetings I am looking for info on how i can get/access html content of an BIG-IP page using curl or code. When i tried to access in curl using it shows http code 302 (Redirection error for login). Is there way to pass auth info in the request when trying to access page.
In browser, when i am logged in i can access below page content, but i would to do it through curl or code. In browser, ui session seems to be passing these cookie info (BIGIPAuthCookie=sdfsdfsd; BIGIPAuthUsernameCookie=admin), but not sure how to create this through code.
shell curl -k -u admin:admin https://10.xxx.xxx.xx/sam/admin/vpe2/public/php/supportTable.php
here</p>
Thanks
7 Replies
- Ryan_80361
Cirrostratus
What is your goal? why do you need the code on a page?
- ctr_159227Historic F5 Account
Goal is to get/scrape the data (as this data is not exposed through API currently) from this page fully within java code, without manual intervention. Parsed data from this page is used some where else.
Dont have much experience with cookies, even if i capture the login request from BIG-IP UI as curl command in dev tools in chrome, curl command fails in shell.
- Ryannnnnnnnn
Altocumulus
What is your goal? why do you need the code on a page?
- ctr_159227Historic F5 Account
Goal is to get/scrape the data (as this data is not exposed through API currently) from this page fully within java code, without manual intervention. Parsed data from this page is used some where else.
Dont have much experience with cookies, even if i capture the login request from BIG-IP UI as curl command in dev tools in chrome, curl command fails in shell.
- Michael_J_17169Historic F5 Account
If your goal is to log into the big-ip, your method might be a little more difficult than just using an iControl Token.
 
Take a look here https://devcentral.f5.com/s/articles/demystifying-icontrol-rest-part-6-token-based-authentication
 
You can pass the token generated (as long as you save it) in your curl.
 
What is the goal of collecting the html?
 
- ctr_159227Historic F5 Account
Thanks. I haven't tried this, I doubt rest token will work with BIG-IP UI. I am dev, I need the scrape the html content, to use this information some where else.
i doubt you can create those, the big-ip will send you them after successful auth.
i would look into curl examples where you login to a website first and try to duplicate that for the big-ip. it might be you will have to use a scripting language.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
