Search code examples
pythonreadability

ImportError: No module named 'readability'


When I run my .py file I am getting this error I have installed readability and lxml it was working before I don't know why it isn't working right no

13:08 ~ $ python3 hiiraanv2.py                                                                                                            
Traceback (most recent call last):
File "hiiraanv2.py", line 6, in <module>
from readability import Document
ImportError: No module named 'readability'

Solution

  • In the readability module documentation, shows that class Document has to be imported from readability.readability.

    Usage Example found in the documentation:

    from readability.readability import Document
    import urllib
    html = urllib.urlopen(url).read()
    readable_article = Document(html).summary()
    readable_title = Document(html).short_title()