Using lxml in IDE with code completion / autocomplete

I am trying to use lxml in pycharm or eclipse, using pydev, everything works correctly, except for the completion of the code, it seems that it does not exist. Is there something I need to implement to make it work with classes from lxml?

For instance:

import lxml.html html = open('html.html', 'r').read() root = lxml.html.fromstring(html) tds = root.cssselect("td.author") print temp[0].text # I know that the text attribute exists but code completion doesn't show it 

Note. Intelligent and intelligent help work for other things, not lxml.

+4
source share
1 answer

This is usually a problem with modules written in C as lxml , where most parsers can only get the signature of the method, but not the details. The signature of the python method has no return type, so it is difficult to guess the type of tds . This lack of information causes the autocomplete function to fail.

Beyond the expectations of IDE authors to improve their parsers, you cannot do much.

+6
source

Source: https://habr.com/ru/post/1401491/


All Articles