这里会显示出您选择的修订版和当前版本之间的差别。
modules:beautifulsoup:tricks [2010/06/02 01:18] |
modules:beautifulsoup:tricks [2010/06/02 01:18] (当前版本) |
||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== BeautifulSoup 技巧 ====== | ||
+ | ===== 得到某一节点下的所有文本===== | ||
+ | <code python> | ||
+ | texts = soup.findAll(text=True) | ||
+ | all_text = "\n".join(texts) | ||
+ | </code> | ||
+ |