从 help(etree.fromstring)
开始,如果没有将 parser
参数传递给函数,则使用默认解析器 .
fromstring(text, parser=None, *, base_url=None)
fromstring(text, parser=None, base_url=None)
Parses an XML document or fragment from a string. Returns the
root node (or the result returned by a parser target).
To override the default parser with a different parser you can pass it to
the ``parser`` keyword argument.
The ``base_url`` keyword argument allows to set the original base URL of
the document to support relative Paths when looking up external entities
(DTD, XInclude, ...).
那么什么是默认解析器?传入的 XMLParser()
实例或解析器对应的数据类型(html,xml等)?