Skip to content

Instantly share code, notes, and snippets.

@elvisoliveira
Forked from alissa-maria/daily-text.py
Last active April 30, 2024 11:21
Show Gist options
  • Select an option

  • Save elvisoliveira/56d92e1bf679df4ea2b78fb2d5adf7aa to your computer and use it in GitHub Desktop.

Select an option

Save elvisoliveira/56d92e1bf679df4ea2b78fb2d5adf7aa 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(class_='themeScrp').get_text(strip=True)
explanation = soup.find(class_='bodyTxt').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