% ls lib/python3.7/site-packages/AdvancedHTMLParser/
Formatter.py
Parser.py
SpecialAttributes.py
Tags.py
Validator.py
__init__.py
compat.py
constants.py
conversions.py
exceptions.py
utils.py
Thus not the xpath subdirectory.
>>> e.getElementsByXPath('thead')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/AdvancedHTMLParser/Tags.py", line 1949, in getElementsByXPathExpression
from . import xpath as axpath
ImportError: cannot import name 'xpath' from 'AdvancedHTMLParser' (/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/AdvancedHTMLParser/__init__.py)
Is it possible that the package description is incomplete and is missing the xpath files?