When you send a search to Wikipedia using the:
URL, it seems like this function returns 3 different manifestations of Wikipedia search:
- An actual article
- A disambiguation page
- A list of articles, like a Google search
3 examples would be:
If you search for “George Washington”:
Would return the George Washington Wikipedia article.
If you search for “tom jones”:
This search returns the disambiguation page for “tom jones”
If you sear for “akbur”
This returns a listing of articles, much like a Google search does.
My question is, when the pages are returned. How do I determine what type of page was returned, just by analyzing the HTML that is present? What keywords or phrases can my program look for in the HTML to definitively determine that I have come upon a Wikipedia article, disambiguation page or a search listing?
This is made more difficult by the seeming inconsistency of the search results. For instance, when searching and a disambiguation page is returned, some of these pages contain the phrase “may refer to:” and some may contain the phrase “may also refer to:”. And some of these key phases may, seemingly have 1, 2 or even 3 spaces, between these words, in these key phrases, which makes using key phrases, to figure out the type of page returned, that much more difficult.