心有法竹
sel.xpath() 得到的依旧是一个SelectorList参看原文档xpath(query)Find nodes matching the xpath query and return the result as a SelectorList instance with all elements flattened. List elements implement Selector interface too.query is a string containing the XPATH query to apply.那么实际上就是去看Selector 相关的函数了。————————————————<p>AA<sub>1</sub><sub>2</sub><sub>3</sub></p><p>BB<sub>1</sub><sub>2</sub><sub>3</sub></p>对于上述例子,其实可以考虑获取到p之后,对其内容再进行一次查找,即可获得 1 、2 、3的内容。