Jun-09-2021, 01:46 PM
(This post was last modified: Jun-11-2021, 08:25 PM by Led_Zeppelin.)
It looks like ll is installed but the test as outlined above failed.
Respectfully,
LZ
import requests from bs4 import BeautifulSoup url = 'http://CNN.com' response = requests.get(url) soup = BeautifulSoup(response.content, 'lxml') print(soup.find('title').text)The output is
Output:FeatureNotFound Traceback (most recent call last)
<ipython-input-3-cd8b12a29240> in <module>
4 url = 'http://CNN.com'
5 response = requests.get(url)
----> 6 soup = BeautifulSoup(response.content, 'lxml')
7 print(soup.find('title').text)
~\miniconda3\lib\site-packages\bs4\__init__.py in __init__(self, markup, features, builder, parse_only, from_encoding, exclude_encodings, element_classes, **kwargs)
241 builder_class = builder_registry.lookup(*features)
242 if builder_class is None:
--> 243 raise FeatureNotFound(
244 "Couldn't find a tree builder with the features you "
245 "requested: %s. Do you need to install a parser library?"
FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library
My guess is that lxml is not in the path. It is installed (see above conda list). Now how do I put it in the path? Assuming that is the correct solution?Respectfully,
LZ