web_programming.covid_stats_via_xpath

This is to show simple COVID19 info fetching from worldometers site using lxml * The main motivation to use lxml in place of bs4 is that it is faster and therefore more convenient to use in Python web projects (e.g. Django or Flask-based)

Attributes

fmt

Classes

CovidData

Functions

covid_stats(→ CovidData)

Module Contents

class web_programming.covid_stats_via_xpath.CovidData

Bases: NamedTuple

cases: int
deaths: int
recovered: int
web_programming.covid_stats_via_xpath.covid_stats(url: str = '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: {}"""