从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等)创建的解析器?