01 2022 档案
摘要:输出 格式化输出,使用prettify()方法将BeautifulSoup文档树格式化以后以Unicode编码输出,每个XML/HTML标签单独占一行 markup = '<a href="http://example.com/">I linked to <i>example.com</i></a>
阅读全文
摘要:bs4 修改文档树 BeautifulSoup还能对文档树进行修改操作,下面主要是列举一些修改文档书的方法 下面的例子都已引入相应的库或包 from bs4 import BeautifulSoup,Comment from bs4.element import NavigableString 修改
阅读全文