GNU/Linux >> Linux Esercitazione >  >> Debian

Installare Python 3 e Beautiful Soup su Debian

Beautiful Soup è una libreria Python per analizzare HTML e XML. Su Debian si installa con il pacchetto python3-bs4.

Installazione

apt-get install -y vim python3
update-alternatives --install /usr/bin/python python /usr/bin/python3.4 2
python --version
apt-get install python3-bs4

Test

Crea scrapetest.py:

from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen("https://www.gnu.org")
bsObj = BeautifulSoup(html.read())
print(bsObj.title)
chmod +x scrapetest.py
./scrapetest.py
Debian
  1. Installare Elasticsearch su Debian Linux

  2. Installare VirtualBox su Debian Linux

  3. Debian – Come installare Python 3.6?

  4. Come installare Python 3.6.4 su Debian 9

  5. Come installare Python 3.10 su Debian 11

Installare Pip per Python 2 e 3 su Debian 10

Come installare Python 3.8 su Debian 10

Installare Python 3.9 su Debian 11

Installare Python 3.9 su Debian 11

Installare Python 3.10 su Debian 11 senza rompere l'interprete di sistema

Come Installare Python 3 su Debian 8