That's a lot of code.
curl -s "https://en.wikipedia.org/w/api.php?action=parse&contentmodel=wikitext&format=json&redirects&explaintext&prop=text§ion=0&page=golang" | jq .parse.text.\"*\" > temp.html; links temp.html
(Scroll that). Not quite the same, but...