for a example: doc = pd(html) text = doc('ul li:eq(-1)').text() it cant't work out but I use text = doc('ul li').eq(-1).text() seems ok