Warning: Undefined array key "HTTP_ACCEPT_LANGUAGE" in /srv/vhost/diaridigital.net/home/html/sourcecode/includes/config.php on line 61

Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/vhost/diaridigital.net/home/html/sourcecode/includes/config.php on line 61
BeautifulSoup4
Source Code

BeautifulSoup4


Tiempo de lectura: 1 minutos

Beautiful Soup es una biblioteca que facilita extraer información de páginas web. Se asienta sobre un analizador HTML o XML, proporcionando modismos Pythonic para iterar, buscar y modificar el árbol de análisis.



Instalar BeautifulSoup

Es recomendable activar el entorno virtual de trabajo en Python, en mi caso el entorno virtual es scrape.

Instalamos pip:

pip install beautifulsoup4

Obtendremos una respuesta similar a esta:

(scrape) (base) Atlas:Python xavier$ pip install 
beautifulsoup4
Collecting beautifulsoup4
  Using cached beautifulsoup4-4.11.1-py3-none-any.
whl (128 kB)
Collecting soupsieve>1.2
  Using cached soupsieve-2.3.2.post1-py3-none-any.
whl (37 kB)
Installing collected packages: soupsieve, 
beautifulsoup4
Successfully installed beautifulsoup4-4.11.1 
soupsieve-2.3.2.post1
(scrape) (base) Atlas:Python xavier$ 

Avisos

Si no tienes la versión de PIP actualizada, te aparecerá un aviso. Utiliza el siguiente comando para actualizar PIP:

python3 -m pip install --upgrade pip

WARNING: You are using pip version 22.0.4; however,
version 22.2.2 is available.
You should consider upgrading via the 
'python3 -m pip install --upgrade pip' command.
Referencias
Xavier es un desarrollador senior full stack y opera desde la ciudad mediterránea de Barcelona. Le encantan las tecnologías de software y está convencido que el desarrollo de software es un proceso colaborativo y abierto.
Y es un apasionado de la astronomía y de la fotografía. Lo puedes encontrar en:
Comparte este post