forked from mouredev/retos-programacion-2023
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mouredev#3306 from blackriper/blackriper
Reto mouredev#18- python
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
Retos/Reto #18 - WEB SCRAPING [Difícil]/python/blackriper.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from requests_html import HTMLSession | ||
""" | ||
instalar libreria pip install requests_html | ||
""" | ||
|
||
|
||
|
||
def main(): | ||
# iniciar objeto de sesion y obtener la pagina | ||
session=HTMLSession() | ||
page=session.get("https://holamundo.day") | ||
|
||
""" | ||
al inspecionar la pagina puedes ver que cada evento de la | ||
charla usa una etiqueta blockquote solo hay que ver cuantos elementos son | ||
y traer el rango en este caso [19:34] | ||
postd: los conte de manera manual para saber el rango debe de haber una mejor manera | ||
de hacerlo | ||
""" | ||
|
||
for event in page.html.find("blockquote")[19:34]: | ||
print(event.text) | ||
|
||
if __name__=='__main__': | ||
main() |