We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe15df3 commit 9160f57Copy full SHA for 9160f57
web_programming/covid_stats_via_xpath.py
@@ -24,7 +24,9 @@ class CovidData(NamedTuple):
24
recovered: str
25
26
27
-def covid_stats(url: str = "https://web.archive.org/web/20250825095350/https://www.worldometers.info/coronavirus/") -> CovidData:
+def covid_stats(
28
+ url: str = "https://web.archive.org/web/20250825095350/https://www.worldometers.info/coronavirus/",
29
+) -> CovidData:
30
xpath_str = '//div[@class = "maincounter-number"]/span/text()'
31
return CovidData(
32
*html.fromstring(httpx.get(url, timeout=10).content).xpath(xpath_str)
0 commit comments