'Initialize the parser. useModule can be used to force it
to use \'BeautifulSoup\' or \'lxml\'; by default, it\'s auto-detected,
using \'lxml\' if available and falling back to \'BeautifulSoup\'
otherwise.'

def __init__(self, useModule=None):

    if (useModule is None):
        useModule = ('lxml', 'BeautifulSoup')
    if (not isinstance(useModule, (tuple, list))):
        useModule = [useModule]
    self._useModule = useModule
    nrMods = len(useModule)
    _gotError = False
    for (idx, mod) in enumerate(useModule):
        mod = mod.strip().lower()
        try:
            if (mod == 'lxml'):
                from lxml.html import fromstring
                from lxml.etree import tostring
                self._is_xml_unicode = False
                self.usingModule = 'lxml'
            elif (mod == 'beautifulsoup'):
                from bsouplxml.html import fromstring
                from bsouplxml.etree import tostring
                self._is_xml_unicode = True
                self.usingModule = 'beautifulsoup'
            else:
                self._logger.warn(('unknown    module    "%s"' % mod))
                continue
            self.fromstring = fromstring
            self._tostring = tostring
            if _gotError:
                warnings.warn(('falling    back    to    "%s"' % mod))
            break
        except ImportError as e:
            if ((idx + 1) >= nrMods):
                raise IMDbError(('unable    to    use    any    parser    in    %s:    %s' % (str(useModule), str(e))))
            else:
                warnings.warn(('unable    to    use    "%s":    %s' % (mod, str(e))))
                _gotError = True
            continue
    else:
        raise IMDbError(('unable    to    use    parsers    in    %s' % str(useModule)))
    self._modFunct = None
    self._as = 'http'
    self._cname = self.__class__.__name__
    self._init()
    self.reset()
