BeautifulSoup brief introduction
BeautifulSoup yes python A third party library , In reptiles , It plays the role of web page parser , Can be downloaded good page element analysis , Extract valuable data , Comparison Lxml,BeautifulSoup The performance will be worse , After all, it's pure python, however BeautifulSoup The support of parsing web pages seems to be better .
install
Enclosed bs4 Official website (https://www.crummy.com/software/BeautifulSoup/)
windows
First of all to enter pip Installation directory , be located Scripts In the folder
And then execute pip install beautifulsoup4

Wait for installation to complete
Linux
$ sudo apt-get python-bs4(python2)
$ sudo apt-get python3-bs4(python3)
Wait for installation to complete
It is easy to use
for instance

Can pass find_all() Method
Find the relevant area , And then through get_text() Access the content below the tag , It can also read href Properties

More methods are used in official documentation , There are also examples on the official website
Xiaobai post , Welcome criticism and correction !!