From 622679c923c492241b4e9a73d648084354397d24 Mon Sep 17 00:00:00 2001 From: AdhilUsman Date: Fri, 16 Oct 2020 15:59:01 +0530 Subject: [PATCH] Get Weather Details of a city --- scripts/weather.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/weather.py diff --git a/scripts/weather.py b/scripts/weather.py new file mode 100644 index 0000000..4c467dd --- /dev/null +++ b/scripts/weather.py @@ -0,0 +1,17 @@ +import requests +from bs4 import BeautifulSoup + +city = input("Enter City Name: ") + +search = 'weather in ' + city + +url = f'https://www.google.com/search?&q={search}' + +r = requests.get(url) + +s = BeautifulSoup(r.text,"html.parser") + +update = s.find("div",class_="BNeawe").text + +print(update) +