Skip to content

Commit d6ff5e4

Browse files
committed
edited weather extractor tutorial
1 parent f11a0a6 commit d6ff5e4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

web-scraping/weather-extractor/weather.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ def get_weather_data(url):
5858
# parse arguments
5959
args = parser.parse_args()
6060
region = args.region
61-
URL += region
61+
if region:
62+
region = region.replace(" ", "+")
63+
URL += f"+{region}"
6264
# get data
6365
data = get_weather_data(URL)
6466
# print data

0 commit comments

Comments
 (0)