0

Given the Wikivoyage page: https://en.wikivoyage.org/wiki/Flores_(Indonesia)

There is a section called "Cities" which is a list that links to other pages within Wikivoyage.

Using the API to retrieve the JSON: https://en.wikivoyage.org/w/api.php?format=json&action=query&prop=extracts&titles=Flores_(Indonesia)

I am receiving the extract (sample):

> <p><span data-country-calling-code=\"+62\"
> data-local-dialing-code=\"\" data-currency=\"IDR,
> Rp\"></span>\n</p>\n\n<p><b>Flores</b> (Portuguese for 'flowers') is
> an island in Nusa Tenggara, Indonesia.\n</p>\n\n\n<h2><span
> id=\"Cities\">Cities</span></h2>\n\n<ul><li><span><span title=\"Map
> for this 'city' marker\">1 </span><span
> id=\"Labuanbajo\"><b>Labuanbajo</b></span></span>  — launching point
> for Komodo Island and diving and snorkeling</li>\n<li><span><span
> title=\"Map for this 'city' marker\">2 </span><span
> id=\"Ruteng\"><b>Ruteng</b></span></span>  — Home to Manggarai ethnic
> minority  interesting local villages. A cooler climate 1,100 meter
> above ground.</li>

All the link anchors are being lost.

I've tried adding the prop=links but it doesn't add all the links from the extract.

Any idea how to get that link information?

Thank you.

James
  • 458
  • 1
  • 6
  • 18
  • Do you want to retrieve the URL of the linked articles, e.g. https://en.wikivoyage.org/wiki/Labuan_Bajo, or the page title of the linked articles, e.g. [[Labuan Bajo]]? – Pascalco Feb 12 '20 at 19:03
  • @Pascal the URLs :) – James Feb 14 '20 at 07:21
  • 1
    Does https://en.wikivoyage.org/w/api.php?format=json&action=parse&page=Flores_(Indonesia) help you? – Pascalco Feb 20 '20 at 21:14
  • 1
    or use https://en.wikivoyage.org/w/api.php?format=json&action=parse&page=Flores_(Indonesia)&prop=links from which you can put together easily the links. – Pascalco Feb 20 '20 at 21:18
  • Thank you @Pascal that did indeed help, using "parse" as an action instead of "query" – James Feb 24 '20 at 15:49

0 Answers0