Wikipedia is a great site to gather information about virtually anything, for example, people, places, technology, and what not. If you like to search for something on Wikipedia from your Python script, this recipe is for you.
Here is an example:
You need to install the
pyyaml third-party library from PyPI using
easy_install by entering
$ pip install pyyaml or
$ easy_install pyyaml.
Let us search for the keyword
Islam in Wikipedia and print each search result in one line.
Listing 6.3 explains how to search for an article in Wikipedia, as shown:
#!/usr/bin/env python # -*- coding: ...