Making HTTP request and parsing the resulting xhtml?

Discussion in 'C++' started by Bart Vandewoestyne, Oct 23, 2012.

  1. Hello all,

    Just for the fun of it, I would like to write a small command line C++ program that grabs a certain value from the website:

    https://www.belfius.be/info/NL/Spar...d.aspx?isinc=BE0159537696&cotype=8&idfund=251

    More specifically, the value '88,65 EUR' in the frame

    https://www.belfius.be/wwwdexiabe/w...8&idfund=251&language=nl#fichefundpension8566

    I assume I will have to make a HTTP request and then parse the resulting XHTML in search for the value. But since I have no experience whatsoever in C++ web programming and parsing XHTML with C++, could someone point me in the right direction? What are the typical libraries I need for this and maybe some example code would also be nice.

    Thanks!
    Bart
     
    Bart Vandewoestyne, Oct 23, 2012
    #1
    1. Advertising

  2. Bart Vandewoestyne

    Ian Collins Guest

    On 10/23/12 20:24, Bart Vandewoestyne wrote:

    **Please wrap your lines!**

    > Hello all,
    >
    > Just for the fun of it, I would like to write a small command line C++ program that grabs a certain value from the website:
    >
    > https://www.belfius.be/info/NL/Spar...d.aspx?isinc=BE0159537696&cotype=8&idfund=251
    >
    > More specifically, the value '88,65 EUR' in the frame
    >
    > https://www.belfius.be/wwwdexiabe/w...8&idfund=251&language=nl#fichefundpension8566
    >
    > I assume I will have to make a HTTP request and then parse the resulting XHTML in search for the value. But since I have no experience whatsoever in C++ web programming and parsing XHTML with C++, could someone point me in the right direction? What are the typical libraries I need for this and maybe some example code would also be nice.


    Three to check out:

    libcurl for the HTTP engine.
    libXML for the parser.
    tidy to fix up crappy HTML prior to parsing.

    I use my own XML parsers, but I do use libcurl and tidy which have well
    documented interfaces.

    --
    Ian Collins
     
    Ian Collins, Oct 23, 2012
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Wallace
    Replies:
    0
    Views:
    1,065
    James Wallace
    Oct 17, 2003
  2. Angus Parvis

    post request + read resulting data

    Angus Parvis, Mar 23, 2005, in forum: Java
    Replies:
    5
    Views:
    552
    Chris Uppal
    Mar 23, 2005
  3. Thomas Fischer
    Replies:
    3
    Views:
    540
    Henry S. Thompson
    Sep 9, 2005
  4. Kavya
    Replies:
    9
    Views:
    515
    Dik T. Winter
    Oct 28, 2006
  5. Rakesh UV

    Missing prototype and resulting coredump

    Rakesh UV, Oct 18, 2007, in forum: C Programming
    Replies:
    3
    Views:
    374
    Barry Schwarz
    Nov 3, 2007
Loading...

Share This Page