Did I find the right examples for you? yes no

All Samples(5)  |  Call(4)  |  Derive(0)  |  Import(1)

src/w/e/weboob-HEAD/weboob/tools/parsers/lxmlparser.py   weboob(Download)
 
from .iparser import IParser
from ..browser import BrokenPageError
 
 
        elif isinstance(nb, basestring) and nb == 'many':
            if results is None or len(results) == 0:
                raise BrokenPageError('Element not found with selector "%s"' % selector)
            elif len(results) == 1:
                raise BrokenPageError('Only one element found with selector "%s"' % selector)
            else:
                return results
        elif isinstance(nb, int) and nb > 0:
            if results is None:
                raise BrokenPageError('Element not found with selector "%s"' % selector)
                raise BrokenPageError('Element not found with selector "%s"' % selector)
            elif len(results) < nb:
                raise BrokenPageError('Not enough elements found (%d expected) with selector "%s"' % (nb, selector))
            else:
                return results[0] if nb == 1 else results