Home html5lib - 'module' object has no attribute 'parse' - what is module from namespace?
Reply: 0

html5lib - 'module' object has no attribute 'parse' - what is module from namespace?

d3im
1#
d3im Published in 2018-01-13 08:31:44Z

have problem on one PC:

Python 3.4.5 (default, Sep 22 2017, 16:16:50) 
[GCC 5.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import html5lib
>>> code='''<span>hello</span>'''
>>> html5lib.parse(code)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'parse'
>>> html5lib
<module 'html5lib' (namespace)>

on another PC it's OK:

Python 3.4.5 (default, Jan  8 2018, 19:14:14) 
[GCC 6.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import html5lib
>>> code='''<span>hello</span>'''
>>> html5lib.parse(code)
<Element '{http://www.w3.org/1999/xhtml}html' at 0x7f53da9805e8>
>>> html5lib
<module 'html5lib' from '/usr/lib64/python3.4/site-packages/html5lib/__init__.py'>

Could somebody explain where is the problem? Thanks in advance!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306231 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO