soup.a.next_sibling.next_siblings
输出:
<generator object next_siblings at 0x03662E90>
返回的是迭代器,所以需要用一下语句输出:
for next in soup.p.next_siblings:
print next
BeautifulSoup标签树的遍历中,以下属性返回的都是迭代类型,需要用在for循环中。
.children
.descendants
.parents
.next_siblings
.previous_siblings