-1

I am writing Qt program in which I can give key word of query and program first generate wikipedia link matching the query and then store data from generated link page into file.

Below is link where I can get my query matching link

QString wikiLink = "http://en.wikipedia.org/w/api.php?action=opensearch&search="
    + soName.replace(" ", "_").toLower() + "_" + soType.toLower()
    + "&format=xml&limit=1";

If my soName and soType are Auriga and Constellation than wikilink is as follow:

http://en.wikipedia.org/w/api.php?action=opensearch&search=auriga_constellation&format=xml&limit=1

Now how can I extract link of my desired article from above link page and then extract data from that article on that link?

svick
  • 236,525
  • 50
  • 385
  • 514
Vijay13
  • 525
  • 2
  • 8
  • 18
  • possible duplicate of [How can I download data from any link?](http://stackoverflow.com/questions/19309726/how-can-i-download-data-from-any-link) – Dmitry Sazonov Oct 11 '13 at 09:22

1 Answers1

0

I would go with QtWebKit which allows you to find elements in the HTML strings.

https://qt-project.org/doc/qt-5.1/qtwebkit/qwebframe.html#findFirstElement

https://qt-project.org/doc/qt-5.1/qtwebkit/qwebelement.html#attribute

bluszcz
  • 4,054
  • 4
  • 33
  • 52