Eli Bendersky added the comment: Gutzwiller, the [position] syntax means the Nth child *of its parent*. Since you placed the second <h1> into <p>, it's the first child of its parent. So the library's behavior is correct here. Note:
>>> [e.text for e in xml.findall('.//h1[1]')] ['1', '2'] ---------- resolution: -> invalid stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17138> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com