From fa0b537a462f05344cbf81ab65579381edbc4280 Mon Sep 17 00:00:00 2001 From: VICTOR LOZOYA Date: Tue, 2 May 2023 12:46:03 +0200 Subject: [PATCH] =?UTF-8?q?Soluci=C3=B3n=20Reto=20#18?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../python/viclg98.py" | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 "Retos/Reto #18 - WEB SCRAPING [Dif\303\255cil]/python/viclg98.py" diff --git "a/Retos/Reto #18 - WEB SCRAPING [Dif\303\255cil]/python/viclg98.py" "b/Retos/Reto #18 - WEB SCRAPING [Dif\303\255cil]/python/viclg98.py" new file mode 100644 index 0000000000..06ca3ed7e3 --- /dev/null +++ "b/Retos/Reto #18 - WEB SCRAPING [Dif\303\255cil]/python/viclg98.py" @@ -0,0 +1,23 @@ +# * El día 128 del año celebramos en la comunidad el "Hola Mundo day" +# * Vamos a hacer "web scraping" sobre su sitio web: https://holamundo.day +# * +# * Crea un programa que se conecte a la web del evento e imprima únicamente la agenda de eventos +# * del día 8. Mostrando hora e información de cada uno. +# * Ejemplo: "16:00 | Bienvenida" +# * +# * Se permite utilizar librerías que nos faciliten esta tarea. + +import requests +from parsel import Selector + +url = "https://holamundo.day" + +response = requests.get(url) + +sel = Selector(response.text) + +agenda = sel.css("blockquote")[-15:] +for event in agenda: + # Print each event to the console + print("".join(event.css("span::text").getall())) +