Created
April 9, 2024 10:09
-
-
Save alissa-maria/e7a892cd74ba7cd9b200bce3b8d710bf to your computer and use it in GitHub Desktop.
Prints daily text + explanation to stdout
This file contains hidden or 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
| import requests | |
| from bs4 import BeautifulSoup | |
| url = 'https://wol.jw.org/en/wol/h/r1/lp-e' | |
| response = requests.get(url) | |
| html_content = response.content | |
| soup = BeautifulSoup(html_content, 'html.parser') | |
| daily_text = soup.find(id='p27').get_text(strip=True) | |
| explanation = soup.find(id='p28').get_text(strip=True) | |
| print(daily_text) | |
| print(explanation) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment