File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 16
16
- id : auto-walrus
17
17
18
18
- repo : https://github.com/astral-sh/ruff-pre-commit
19
- rev : v0.12.9
19
+ rev : v0.12.10
20
20
hooks :
21
21
- id : ruff-check
22
22
- id : ruff-format
47
47
- id : validate-pyproject
48
48
49
49
- repo : https://github.com/pre-commit/mirrors-mypy
50
- rev : v1.15.0
50
+ rev : v1.17.1
51
51
hooks :
52
52
- id : mypy
53
53
args :
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ def is_breakable(index: int) -> bool:
90
90
if index == len_string :
91
91
return True
92
92
93
- trie_node = trie
93
+ trie_node : Any = trie
94
94
for i in range (index , len_string ):
95
95
trie_node = trie_node .get (string [i ], None )
96
96
Original file line number Diff line number Diff line change 1
1
"""
2
- This is to show simple COVID19 info fetching from worldometers site using lxml
2
+ This is to show simple COVID19 info fetching from worldometers archive site using lxml
3
3
* The main motivation to use lxml in place of bs4 is that it is faster and therefore
4
4
more convenient to use in Python web projects (e.g. Django or Flask-based)
5
5
"""
19
19
20
20
21
21
class CovidData (NamedTuple ):
22
- cases : int
23
- deaths : int
24
- recovered : int
22
+ cases : str
23
+ deaths : str
24
+ recovered : str
25
25
26
26
27
- def covid_stats (url : str = "https://www.worldometers.info/coronavirus/" ) -> CovidData :
27
+ def covid_stats (
28
+ url : str = "https://web.archive.org/web/20250825095350/https://www.worldometers.info/coronavirus/" ,
29
+ ) -> CovidData :
28
30
xpath_str = '//div[@class = "maincounter-number"]/span/text()'
29
31
return CovidData (
30
32
* html .fromstring (httpx .get (url , timeout = 10 ).content ).xpath (xpath_str )
You can’t perform that action at this time.
0 commit comments