There are a few ways to extract text from a web page, but the best way to keep the original formatting is to use a tool like WebCopy or HTTrack.
Personality test in c++ using OOP classes