Question

I'm using the MediaWiki API to extract links from a Wikipedia page. The following query is used to extract links from Albert Einstein's page:

string query = "http://en.wikipedia.org/w/api.php?action=query&titles=Albert%20Einstein&prop=links"

I'm using C# to produce this query, via an HTTP GET command:

string responseInfo = (new WebClient()).DownloadString(query);

My question is: How can I map the links to actual Wikipedia pages? For example, the link "Absorption refrigerator" maps to the web page "Absorption_refrigerator". How can I determine this programmatically? Can I always assume that a white space maps to an underscore?

Was it helpful?

Solution

Wikipedia ALWAYS processes white spaces as underscores

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top