Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError in getHtml #17

Open
JiriKalvoda opened this issue Sep 24, 2023 · 0 comments
Open

TypeError in getHtml #17

JiriKalvoda opened this issue Sep 24, 2023 · 0 comments

Comments

@JiriKalvoda
Copy link

Hi!

Nice library.

I have only one small problem. When i try print tag which contain attribute with None value, print fail.

Here is simple code to reproduce that:

import AdvancedHTMLParser

parser = AdvancedHTMLParser.AdvancedHTMLParser()
parser.parseStr('<div itemscope itemtype="http://schema.org/Order">')
parser.getHTML()

Returnung:

Traceback (most recent call last):
  File "/home/jiri/userconfig/mail/error.py", line 5, in <module>
    parser.getHTML()
  File "/tmp/p/venv/lib/python3.11/site-packages/AdvancedHTMLParser/Parser.py", line 887, in getHTML
    return doctypeStr + rootNode.outerHTML
           ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str

Observed on python 3.11.5 (Arch linux) with up-to-date package from pip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant