I am a mathematics student and I want to get data of options from https://bigcharts.marketwatch.com/quickchart/options.asp?symb=SPX into c++ (the strike prices etc.), but is there a way to import it from there into my program without just typing it into my file? I have no clue. If another website admits this more easily, this is also fine of course.
1 Answer
What you are asking is less of a Computer Science and more of a programming question and belongs on a C++ focussed board or StackOverflow. That being said if you have the data downloaded as a file locally on your machine it is rather trivial to read it's contents into your application's memory using file streams. If you are asking whether it's possible to download the data directly, the answer becomes none trivial: first you probably want a way to download from a website. Libcurl is a popular library that can achieve that, but any library that can perform network IO (specifically HTTP) will do the trick. Once downloaded it's pretty much the same as having it locally, meaning you need to parse the data.
Whatever you are trying to do, unless you have a background in C++ or are sure you need the performance C++ delivers, I'd advise you use Python instead. IO and parsing are tedious in C++ but comparatively trivial in Python.