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?

有帮助吗?

解决方案

Wikipedia ALWAYS processes white spaces as underscores

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top