Making HTTP request and parsing the resulting xhtml?

B

Bart Vandewoestyne

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
 
I

Ian Collins

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top