Find Date

What can I do to find the date in the HTML page of a Yahoo Finance Page?
Last edited on
Use an XML parser to parse the HTML, and use XPATH to extract the element you want (libxml++ for example). Or use the Boost Regex library to parse the HTML with a regular expression. Or you can write your own custom parser using some of the simplistic "find" functions of std::string.
Why are you doing this with C++?

If you are serious about parsing the quote information from Yahoo, you probably want to look at embedding a JavaScript engine in your C++ code so that you can process the data. Otherwise you will need to parse the JavaScript too, extract the data and pass that to a JSON parser.

This can be done -- libxml++, v8, and libcurl (or Boost Asio) will do the trick.

What OS are you writing this on?
I have to do it in C++ only, its a requirement. I have written my own parser. I use the keyword "yfi_fp_market_summary" to locate the date but bcose the date is written in words in the HTML page of the Yahoo Finance Singapore page, m nt sure.

Secondly, I tried to get the stock index values associated with the stock index names in the Yahoo Finance Page. Although I get some values, they keep repeating for each index name which means that function also doesn't work properly.
Topic archived. No new replies allowed.