Manual:Pywikibot/pagegenerators.py

pagegenerators.py can generate a list of pages.

This module offers a wide variety of page generators. A page generator is an object that is iterable (see https://www.python.org/dev/peps/pep-0255/) and that yields page objects on which other scripts can then use.

Command line usage
The core version of pagegenerators.py may not be executed directly. Instead, the script  is used.

Example:

This will return, in standard output, a list of all pages containing "foobar," as returned by MediaWiki's search engine.

Calls from another program
Category crawler:

Subcategories explorer:

MySQL requests (see ):

Unicode recommendation
The following code returns KeyError: 'query' because of the special character:

If searching in user and mediawiki namespaces, it would look like

Consequently, [http://toolserver.org/~jackpotte/unicode-HTML.html an encoding conversion] is needed:

It seems like the best documentation can be found at the source,  .