recommend `lxml.html` instead of `etree.html` in document

Bug #2039353 reported by abcd
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Fix Committed
Low
scoder

Bug Description

https://lxml.de/parsing.html#parsing-html

it probably should recommend `lxml.html` instead of `etree.html` (may still keep in code) in document since `etree.html` is actually just an alias of `etree.parse` or `etree.fromstring`.

if people didn't read the source code, the document is currently confusing ppl because why there're many different ways for HTML parsing in the document.

https://github.com/lxml/lxml/blob/bf6a2739d02b6bab2c4543281f16a17c576efbf9/src/lxml/etree.pyx#L3184

abcd (abcdun)
description: updated
Revision history for this message
scoder (scoder) wrote :
Changed in lxml:
assignee: nobody → scoder (scoder)
importance: Undecided → Low
milestone: none → 5.0
status: New → Fix Committed
Revision history for this message
scoder (scoder) wrote :

Note that "help(etree.HTML)" would also have given you this information.

Revision history for this message
abcd (abcdun) wrote :

no,
```
>>> import lxml.etree
>>> help(lxml.etree.HTML)
Help on cython_function_or_method in module lxml.etree:

HTML(text, parser=None, *, base_url=None)
    HTML(text, parser=None, base_url=None)

    Parses an HTML document from a string constant. Returns the root
    node (or the result returned by a parser target). This function
    can be used to embed "HTML literals" in Python code.

    To override the parser with a different ``HTMLParser`` 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, ...).

>>> lxml.__version__
'4.9.2'
>>>
```

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.