-4

I am currently writing a Windows application with multiple features in MS Visual Studio 2013 in C++. One of the features has to be that it can plot actual data on the screen. I have succeeded in plotting the graph, but I have not been able yet to get the data. With the Wininet library I can make a connection to a website and save the HTML code in a file. For some websites this is enough, because the data is part of the HTML code and after parsing it, I can plot the data. But the website I want to retrieve the data from is written in Java and the data are Java objects. Now I have downloaded the RapidjSON library to handle Java objects. Can anyone help me further with how to retrieve the Java objects from the website? Are there any libraries for this that I do not know of? Can I send requests to the webserver with WiniNet and get the data?

I have also noticed that if I save the complete website in Chrome, the data is present in the document. But when I save it with the C++ WiniNet program, the data is not present in the document. Would there be a way to save the data as well?

Robert Smit
  • 183
  • 1
  • 1
  • 6

1 Answers1

0

For anyone struggling with the same question: There is a webdriver called Selenium, which can control different types of browsers (For example IE, Chrome or the headless browser PhantomJS). Unfortunately I had to use C#, because the Dll's don't support C++. With the FindElement() function you can retrieve any element on the page by searching for the id, classname, tagname etc. in the CSS. You can click on an element, type text into it or retrieve text from it. The latter made it possible for me to retrieve Java objects from the page.

The only downside of the Selenium webdriver is the slowliness, but overall it will do the job.

Robert Smit
  • 183
  • 1
  • 1
  • 6