What you want to do is to use action=query&prop=links
to get data from the pagelinks
database table, instead of parsing the page text.
This will still give you only page titles (because a link can lead to a non-existent page, which implies no page id).
But you can fix that by using prop=links
as a generator:
If the article has many links (like the one you suggested), you will need to use paging (see the gplcontinue
element).