How to fix remote cssselect package issue in lxml?

So they removed the cssselect package from lxml. Now my python program is useless. I just can't figure out how I can make it work:

ImportError: cssselect does not seem to be installed. See http://packages.python.org/cssselect/

I tried to copy the cssselect directory to my code directory → solves the error when compiling the bytecode files, but the error persists when the program starts.

I tried to rewrite my lxml.cssselect commands, but there was no result.

I searched the entire internet, but with no response.

I now have a line:

from lxml.html import parse

and the code using cssselect is

inner = html.xpath('//*[@id="Content..."]')
for b in inner:
...
  for a in b.cssselect('p'):
  ...

So how to import it so that the source code works? Do I need to manually copy it to some place or what?

or how to find / replace code to make it work?

(oh note, ofc lxml, cssselect)

+4
2

cssselect. - cssselect /root/.local/lib/python2.7/site-packages//usr/local/lib/python2.7/dist-packages/.

Cssselect pip install cssselect Debian GNU/Linux 7.4 (wheezy, Linux 3.2.0-4-amd64 x86_64). , - .

, cssselect . , -. python.

Ty, ;)

+4

cssselect pip3:

sudo pip3 install cssselect
+3

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


All Articles