From 35ba5ab50d5b8d8a88d8763cfbab17f08634d9bf Mon Sep 17 00:00:00 2001 From: mjordanaam Date: Tue, 2 May 2023 17:19:15 +0200 Subject: [PATCH] Reto #18 - Python --- .../python/mjordanaam.py" | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 "Retos/Reto #18 - WEB SCRAPING [Dif\303\255cil]/python/mjordanaam.py" diff --git "a/Retos/Reto #18 - WEB SCRAPING [Dif\303\255cil]/python/mjordanaam.py" "b/Retos/Reto #18 - WEB SCRAPING [Dif\303\255cil]/python/mjordanaam.py" new file mode 100644 index 0000000000..7627c74cd3 --- /dev/null +++ "b/Retos/Reto #18 - WEB SCRAPING [Dif\303\255cil]/python/mjordanaam.py" @@ -0,0 +1,35 @@ +""" +/* + * 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 bs4 import BeautifulSoup + +url = "https://holamundo.day" + +page = requests.get(url) + +soup = BeautifulSoup(page.content, "html.parser") + +results = soup.find_all("blockquote", class_="BlockquoteElement___StyledBlockquote-sc-1dtx4ci-0 slate-BlockquoteElement notion-quote unset-width") + +dates = [] + +for result in results: + dates.append(result.text) + + +print(">_Agenda 8 de mayo | “Hola Mundo” day") + +for activity in dates[19:]: + print(activity) + \ No newline at end of file