Skip to content

Commit

Permalink
Merge pull request #3309 from Red-Clay/reto18
Browse files Browse the repository at this point in the history
Reto #18 - Python
  • Loading branch information
migueltortg authored May 2, 2023
2 parents b6b5c1b + b2f8026 commit 100d91b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Retos/Reto #18 - WEB SCRAPING [Difícil]/phyton/redclay.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import requests
from bs4 import BeautifulSoup

def Titulo(tag):
return tag.name=="h1" and "Agenda 8 de mayo" in tag.text

def ResponseAgenda(url):
response = requests.get(url)
html = response.text
soup = BeautifulSoup(html, 'html.parser')

Fecha = soup.find(Titulo)
Horario = Fecha.find_all_next("blockquote", {"class": "BlockquoteElement___StyledBlockquote-sc-1dtx4ci-0 slate-BlockquoteElement notion-quote unset-width"})
for Hora in Horario:
print(Hora.get_text())

url="https://holamundo.day/"
ResponseAgenda(url)

0 comments on commit 100d91b

Please sign in to comment.