Answer the question
In order to leave comments, you need to log in
How to connect the html.parser library to bs4 if bs4 is installed locally in the project folder?
There is a project where the libraries folder is located, it contains libraries so that a person does not install packages when using my application.
Test code:
from libraries.beautifulsoup4.bs4 import BeautifulSoup
html = '<div> Hello! </div>'
soup = BeautifulSoup(html, 'html.parser')
print(soup.find('div'))
Answer the question
In order to leave comments, you need to log in
If you look at the source , you can see that it has its own htmlparser, which, by the way, implies that bs4 is imported, and in general. Obviously, you need to do many, many direct imports of everything that is used there.
But I would be more careful about copying libraries - there may be binaries compiled during installation or compiled in advance for your system.
Better use pip to create requirements.txt and then
pip install -r requirements.txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question