mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
Enable ruff S113 rule (#11375)
* Enable ruff S113 rule * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -18,7 +18,9 @@ class CovidData(NamedTuple):
|
||||
|
||||
def covid_stats(url: str = "https://www.worldometers.info/coronavirus/") -> CovidData:
|
||||
xpath_str = '//div[@class = "maincounter-number"]/span/text()'
|
||||
return CovidData(*html.fromstring(requests.get(url).content).xpath(xpath_str))
|
||||
return CovidData(
|
||||
*html.fromstring(requests.get(url, timeout=10).content).xpath(xpath_str)
|
||||
)
|
||||
|
||||
|
||||
fmt = """Total COVID-19 cases in the world: {}
|
||||
|
Reference in New Issue
Block a user