web_programming.covid_stats_via_xpath¶
This script demonstrates fetching simple COVID-19 statistics from the Worldometers archive site using lxml. lxml is chosen over BeautifulSoup for its speed and convenience in Python web projects (such as Django or Flask).
Attributes¶
Classes¶
Functions¶
|
Module Contents¶
- class web_programming.covid_stats_via_xpath.CovidData¶
Bases:
NamedTuple
- cases: str¶
- deaths: str¶
- recovered: str¶
- web_programming.covid_stats_via_xpath.covid_stats(url: str = 'https://web.archive.org/web/20250825095350/https://www.worldometers.info/coronavirus/') CovidData ¶
- web_programming.covid_stats_via_xpath.fmt = Multiline-String¶
Show Value
"""Total COVID-19 cases in the world: {} Total deaths due to COVID-19 in the world: {} Total COVID-19 patients recovered in the world: {}"""