Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser issue with lxml + bs4 #119

Closed
tshrjn opened this issue Mar 26, 2017 · 5 comments
Closed

Parser issue with lxml + bs4 #119

tshrjn opened this issue Mar 26, 2017 · 5 comments

Comments

@tshrjn
Copy link

tshrjn commented Mar 26, 2017

I'm getting the following error:

Traceback (most recent call last):
  File "login.py", line 30, in <module>
    client = fbchat.Client(os.environ['FB_ID'], os.environ['FB_PASS'])
  File "/Users/tshrjn/anaconda3/lib/python3.5/site-packages/fbchat/client.py", line 122, in __init__
    self.login(email, password, max_retries)
  File "/Users/tshrjn/anaconda3/lib/python3.5/site-packages/fbchat/client.py", line 281, in login
    if not self._login():
  File "/Users/tshrjn/anaconda3/lib/python3.5/site-packages/fbchat/client.py", line 224, in _login
    soup = bs(self._get(MobileURL).text, "lxml")
  File "/Users/tshrjn/anaconda3/lib/python3.5/site-packages/bs4/__init__.py", line 165, in __init__
    % ",".join(features))
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?

On looking around, I found that this used to be a bs4 issue which got resolved in its 4.0.3 update.
Versions I am using are as follows:

pip list
beautifulsoup4 (4.5.3)
fbchat (0.7.1)
lxml (3.7.3)

Please help me resolve this issue cause I'm not even able to login.

@mw866
Copy link

mw866 commented Mar 26, 2017

Same here. I observed the same issue on MacOS Sierra. It is fine on Ubuntu 16.04.

@Bankde
Copy link
Contributor

Bankde commented Mar 28, 2017

I don't have time to look into it yet. If someone has, hope this help.

Using Cygwin, working fine.
beautifulsoup4 (4.5.1)
fbchat (0.6.0)
lxml (3.4.4)
Centos working fine
beautifulsoup4 (4.5.1)
fbchat (0.6.0)
lxml (3.6.4)

Haven't tried on OSX though, but possibly an OSX dependency issue.

@TimLChan
Copy link
Contributor

TimLChan commented Apr 1, 2017

Have you tried the following command on the lxml site?
sudo port install py27-lxml

I had the same issue, but I ended up using sudo apt-get install python3-lxml instead of the default pip install lxml that's part of the install script since my vps doesn't have the memory to compile (128mb)

Also, see if the following throws an error

import lxml
from lxml import etree

@madsmtm
Copy link
Member

madsmtm commented May 5, 2017

Cannot reproduce on MacOS Sierra. Don't think this is related to fbchat

@CDevs
Copy link

CDevs commented Jun 21, 2017

I also had this issue on Windows 7. I believe it is a problem with the lxml install. I tested it by running -

import lxml
import lxml.etree

and this reproduced the error.

I fixed by followed the instructions on this Stackoverflow post: https://stackoverflow.com/questions/29440482/how-to-install-lxml-on-windows

I realise this fix is for Windows and not MacOS however I think OP should look at their lxml install as I believe that will be where the issue lies. For anyone on Windows, try the fix in the Stackoverflow post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants