I have webpage I downloaded with C++ to a string, and it is basically a massive <li>
list of links. I need to find the last 2 elements of the list. Can anyone help me on how to do this?
views:
61answers:
2
+3
A:
If you are going to do it in a robust way you need an html parser. If the structure of the html is simple enough, and the runtime not an issue, something as stupid as doing string.rfind("<li>") twice might be good enough to find the positions of your elements. Then just do something even more hacky to find the end of each element like look for the next newline
frankc
2010-04-26 23:52:55
Alright thank you.
David Powers
2010-04-27 00:39:05