Dec-11-2018, 06:11 AM
Code:
__pycache__
Containing 1 compiled/binary file:
lxml.cpython-36.pyc
If I run exactly the same code via the python3 CLI, no such error is returned, no such sub-folder is created and I can view and process the response text as expected.
I have removed and reinstalled python3-bs4, but the problem continues.
Any assistance would be much appreciated.
#!/usr/bin/python3 import requests from bs4 import BeautifulSoup url = "https://pythonprogramming.net/parsememcparseface/" resp = requests.get(url) txt = resp.text soup = BeautifulSoup(txt, 'lxml')The following error is now being produced on unchanged code that was previously working (2 days ago):
Traceback (most recent call last): File "./xtest.py", line 10, in <module> soup = BeautifulSoup(txt, 'lxml') File "/usr/lib/python3/dist-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?Additionally, at the same point the error message is returned, a new sub-folder is created:
__pycache__
Containing 1 compiled/binary file:
lxml.cpython-36.pyc
If I run exactly the same code via the python3 CLI, no such error is returned, no such sub-folder is created and I can view and process the response text as expected.
I have removed and reinstalled python3-bs4, but the problem continues.
Any assistance would be much appreciated.