kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.45k stars 633 forks source link

ImportError: lxml.html.clean module is now a separate project lxml_html_clean #1106

Open escobar5 opened 4 months ago

escobar5 commented 4 months ago

I'm getting this error running facebook-scraper:

Traceback (most recent call last): File "/Users/escobar5/.local/bin/facebook-scraper", line 5, in from facebook_scraper.main import run File "/Users/escobar5/.local/pipx/venvs/facebook-scraper/lib/python3.12/site-packages/facebook_scraper/init.py", line 13, in from .facebook_scraper import FacebookScraper File "/Users/escobar5/.local/pipx/venvs/facebook-scraper/lib/python3.12/site-packages/facebook_scraper/facebook_scraper.py", line 15, in from requests_html import HTMLSession File "/Users/escobar5/.local/pipx/venvs/facebook-scraper/lib/python3.12/site-packages/requests_html.py", line 14, in from lxml.html.clean import Cleaner File "/Users/escobar5/.local/pipx/venvs/facebook-scraper/lib/python3.12/site-packages/lxml/html/clean.py", line 18, in raise ImportError( ImportError: lxml.html.clean module is now a separate project lxml_html_clean. Install lxml[html_clean] or lxml_html_clean directly.

Python 3.12.4

BinhPQ2 commented 4 months ago

Try to

pip install lxml_html_clean

It might do the trick. This worked for me