Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1033515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:14:37+00:00 2026-05-16T14:14:37+00:00

I was wondering if you could help me work through accessing the html behind

  • 0

I was wondering if you could help me work through accessing the html behind a login page using C and libcurl.

Specific Example:

The website I’m trying to access is https://onlineservices.ubs.com/olsauth/ex/pbl/ubso/dl

Is it possible to do something like this?

The problem is that we have a lot of clients each of which has a separate login. We need to get data from each of their accounts every day. It would be really slick if we could write something in C to do this and save all the pertinent data into a file. (like the values of the accounts and positions which I can parse from the html)

What do you guys think? Is this possible and could you help point me in the right direction with some examples, etc…?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:14:38+00:00Added an answer on May 16, 2026 at 2:14 pm

    After a cursory glance at the login page, it is possible to do this with libcurl, by posting the username/password combo to their authenticating page, and assuming they use cookies to represent a login session. The first step is to make sure that you’ve got the following options set:

    • CURLOPT_FOLLOWLOCATION – The server may redirect after authenticating, this is quite common.
    • CURLOPT_POST – This tells libcurl to switch into post mode.
    • CURLOPT_POSTFIELDS – This tells libcurl the values to set for the post fields. Set this option to “userId=<insert username>&password=<insert password>“. That value is derived from the source code for that page.
    • CURLOPT_USERAGENT – Set a simple user-agent, so that the web server won’t throw it out (some strict ones will do this).

    Then, once the post is complete, the libcurl instance should contain some sort of authorisation cookie used by the site to identify a logged-in user. Curl should keep track of cookies within a given instance. There are plenty of options for Curl if you want to tweak how cookies behave.

    Make sure that once you are ‘logged-in’ that the same libcurl instance is used for each request under that account, otherwise it will see you as logged out.

    As for parsing the resulting pages go, there are tonnes of HTML parsers for c – just google. The only thing I will say is do not try to write an HTML parser yourself. It is notoriously tricky, because a lot of sites don’t produce good (or even working) HTML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering if anyone could help me with the following. I work remotely
Hello fellow Grails Developers! I was wondering if you could help me with what
I was wondering if anyone could help me out with jQuery file tree (
I was wondering if there was any way through php or javascript I could
I was wondering if someone could help me with creating a while loop to
I was wondering if someone could help with i jQuery plugin. Basically what I
I was wondering if anyone could help me with this minor problem. I want
wondering if you could shed light for me please! I'm using http://jquery-ui-map.googlecode.com/svn/trunk/demos/google-maps-jquery-filtering.html and I
I was wondering if anyone could help clear up this issue I am having.
i was wondering if anyone could help me with css. ive been stuck on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.