求python BeautifulSoup能获取到无标签文本的方法,,

aaa

bb


<p>aaa</p>bbb<p>ccc</p>ddd

怎么获取bbb和ddd呢?

可以使用findAll()的text参数。

text is an argument that lets you search for NavigableString objects instead of Tags. Its value can be a string, a regular expression, a list or dictionary, True or None, or a callable that takes a NavigableString object as its argument:

编橙之家文章,

评论关闭