python - Pylint Error Message: "E1101: Module 'lxml.etree' has no 'strip_tags' member'" -


i experimenting lxml , python first time personal project, , attempting strip tags bit of source code using etree.strip_tags().

for reason, keep getting error message: "e1101: module 'lxml.etree' has no 'strip_tags' member'".

i'm not sure why happening.

here's relevant portion of code:

from lxml import etree  ...  doc = etree.strip_tags(doc_url, 'html') print doc 

any ideas?

thanks.

the reason pylint default only trusts c extensions standard library , ignore aren't.

as lxml isn't part of stdlib, have whitelist manually. this, navigate directory of project in terminal, , generate rcfile pylint:

$ pylint --generate-rcfile > .pylintrc 

then, open file , edit add lxml whitelist so:

extension-pkg-whitelist=lxml 

after that, e1101 errors regarding lxml should vanish.

more details in answer.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -