Skip to content

Instantly share code, notes, and snippets.

@alissa-maria
Created April 9, 2024 10:09
Show Gist options
  • Select an option

  • Save alissa-maria/e7a892cd74ba7cd9b200bce3b8d710bf to your computer and use it in GitHub Desktop.

Select an option

Save alissa-maria/e7a892cd74ba7cd9b200bce3b8d710bf to your computer and use it in GitHub Desktop.
Prints daily text + explanation to stdout
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