Skip to content

Commit 76e6020

Browse files
authored
upgrade covid_stats_via_xpath.py
1 parent 69459b3 commit 76e6020

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

web_programming/covid_stats_via_xpath.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ def covid_stats(
3333
) -> CovidData:
3434
xpath_str = '//div[@class = "maincounter-number"]/span/text()'
3535
try:
36-
response = httpx.get(url, timeout=10)
37-
response.raise_for_status()
36+
response = httpx.get(url, timeout=10).raise_for_status()
3837
except httpx.TimeoutException:
3938
print(
4039
"Request timed out. Please check your network connection "

0 commit comments

Comments
 (0)